diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2014-08-25 20:44:06 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2014-08-28 13:13:54 (GMT) |
commit | 328e8694335ca76fb29ebd5fafe4456a89ac25c7 (patch) | |
tree | ebd88c211455ff0a7a1ce8081b1c48bcd01fc214 /Tests/RunCMake | |
parent | c2a47a9ac3fef38d9da6260725708c2246c1b9c1 (diff) | |
download | CMake-328e8694335ca76fb29ebd5fafe4456a89ac25c7.zip CMake-328e8694335ca76fb29ebd5fafe4456a89ac25c7.tar.gz CMake-328e8694335ca76fb29ebd5fafe4456a89ac25c7.tar.bz2 |
StringUuid: Implement new string(UUID) sub-command.
Diffstat (limited to 'Tests/RunCMake')
20 files changed, 79 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake index 501acd2..e83db27 100644 --- a/Tests/RunCMake/string/RunCMakeTest.cmake +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -2,3 +2,11 @@ include(RunCMake) run_cmake(Concat) run_cmake(ConcatNoArgs) + +run_cmake(Uuid) +run_cmake(UuidMissingNamespace) +run_cmake(UuidMissingNamespaceValue) +run_cmake(UuidBadNamespace) +run_cmake(UuidMissingNameValue) +run_cmake(UuidMissingTypeValue) +run_cmake(UuidBadType) diff --git a/Tests/RunCMake/string/Uuid.cmake b/Tests/RunCMake/string/Uuid.cmake new file mode 100644 index 0000000..2613d26 --- /dev/null +++ b/Tests/RunCMake/string/Uuid.cmake @@ -0,0 +1,17 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE MD5) + +if(NOT WWW_EXAMPLE_COM_MD5_UUID STREQUAL "5df41881-3aed-3515-88a7-2f4a814cf09e") + message(SEND_ERROR + "UUID did not create the expected MD5 result: ${WWW_EXAMPLE_COM_MD5_UUID}") +endif() + +string(UUID WWW_EXAMPLE_COM_SHA1_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE SHA1 UPPER) + +if(NOT WWW_EXAMPLE_COM_SHA1_UUID STREQUAL "2ED6657D-E927-568B-95E1-2665A8AEA6A2") + message(SEND_ERROR + "UUID did not create the expected SHA1 result: ${WWW_EXAMPLE_COM_SHA1_UUID}") +endif() diff --git a/Tests/RunCMake/string/UuidBadNamespace-result.txt b/Tests/RunCMake/string/UuidBadNamespace-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidBadNamespace-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidBadNamespace-stderr.txt b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt new file mode 100644 index 0000000..cb12903 --- /dev/null +++ b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidBadNamespace.cmake:3 \(string\): + string UUID sub-command, malformed NAMESPACE UUID. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidBadNamespace.cmake b/Tests/RunCMake/string/UuidBadNamespace.cmake new file mode 100644 index 0000000..f607925 --- /dev/null +++ b/Tests/RunCMake/string/UuidBadNamespace.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-fooo-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE MD5) diff --git a/Tests/RunCMake/string/UuidBadType-result.txt b/Tests/RunCMake/string/UuidBadType-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidBadType-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidBadType-stderr.txt b/Tests/RunCMake/string/UuidBadType-stderr.txt new file mode 100644 index 0000000..1993c04 --- /dev/null +++ b/Tests/RunCMake/string/UuidBadType-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidBadType.cmake:3 \(string\): + string UUID sub-command, unknown TYPE 'FOO'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidBadType.cmake b/Tests/RunCMake/string/UuidBadType.cmake new file mode 100644 index 0000000..bf4909e --- /dev/null +++ b/Tests/RunCMake/string/UuidBadType.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE FOO) diff --git a/Tests/RunCMake/string/UuidMissingNameValue-result.txt b/Tests/RunCMake/string/UuidMissingNameValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNameValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt new file mode 100644 index 0000000..0b7cde4 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingNameValue.cmake:3 \(string\): + string UUID sub-command, NAME requires a value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNameValue.cmake b/Tests/RunCMake/string/UuidMissingNameValue.cmake new file mode 100644 index 0000000..407a1d7 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNameValue.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} TYPE MD5 NAME) diff --git a/Tests/RunCMake/string/UuidMissingNamespace-result.txt b/Tests/RunCMake/string/UuidMissingNamespace-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespace-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt new file mode 100644 index 0000000..dfcfe42 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingNamespace.cmake:3 \(string\): + string UUID sub-command, malformed NAMESPACE UUID. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNamespace.cmake b/Tests/RunCMake/string/UuidMissingNamespace.cmake new file mode 100644 index 0000000..5a71e4f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespace.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAME www.example.com TYPE MD5) diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue-result.txt b/Tests/RunCMake/string/UuidMissingNamespaceValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespaceValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt new file mode 100644 index 0000000..86585ad --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingNamespaceValue.cmake:3 \(string\): + string UUID sub-command, NAMESPACE requires a value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue.cmake b/Tests/RunCMake/string/UuidMissingNamespaceValue.cmake new file mode 100644 index 0000000..f2219c0 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingNamespaceValue.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAME www.example.com TYPE MD5 NAMESPACE) diff --git a/Tests/RunCMake/string/UuidMissingTypeValue-result.txt b/Tests/RunCMake/string/UuidMissingTypeValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingTypeValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt new file mode 100644 index 0000000..70252f8 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UuidMissingTypeValue.cmake:3 \(string\): + string UUID sub-command, TYPE requires a value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/UuidMissingTypeValue.cmake b/Tests/RunCMake/string/UuidMissingTypeValue.cmake new file mode 100644 index 0000000..6678a46 --- /dev/null +++ b/Tests/RunCMake/string/UuidMissingTypeValue.cmake @@ -0,0 +1,4 @@ +set(UUID_DNS_NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8) + +string(UUID WWW_EXAMPLE_COM_MD5_UUID + NAMESPACE ${UUID_DNS_NAMESPACE} NAME www.example.com TYPE) |