diff options
author | Brad King <brad.king@kitware.com> | 2016-09-13 15:40:47 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-09-13 15:40:47 (GMT) |
commit | 994e98bf415183a6b360f05a43cedf53778e5a7a (patch) | |
tree | 5248ea7bc129bc721f24fc4230f1defcf97c42cf /Tests | |
parent | f51f4ee9a34faeeb6ed22ea4e894dbac7572abc7 (diff) | |
parent | 410add400803340581eccf5ac1c83c8d4e40ad5a (diff) | |
download | CMake-994e98bf415183a6b360f05a43cedf53778e5a7a.zip CMake-994e98bf415183a6b360f05a43cedf53778e5a7a.tar.gz CMake-994e98bf415183a6b360f05a43cedf53778e5a7a.tar.bz2 |
Merge topic 'timestamp-names'
410add40 Help: Add notes for topic 'timestamp-names'
751f7b52 string(TIMESTAMP ...): add '%a' and '%b' format specifiers
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeTests/String-TIMESTAMP-MonthWeekNames.cmake | 11 | ||||
-rw-r--r-- | Tests/CMakeTests/StringTest.cmake.in | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CMakeTests/String-TIMESTAMP-MonthWeekNames.cmake b/Tests/CMakeTests/String-TIMESTAMP-MonthWeekNames.cmake new file mode 100644 index 0000000..1cd44ff --- /dev/null +++ b/Tests/CMakeTests/String-TIMESTAMP-MonthWeekNames.cmake @@ -0,0 +1,11 @@ +string(TIMESTAMP output "%a;%b") +message("~${output}~") + +list(LENGTH output output_length) + +set(expected_output_length 2) + +if(NOT output_length EQUAL ${expected_output_length}) + message(FATAL_ERROR "expected ${expected_output_length} entries in output " + "with all specifiers; found ${output_length}") +endif() diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in index aba35fe..a45b205 100644 --- a/Tests/CMakeTests/StringTest.cmake.in +++ b/Tests/CMakeTests/StringTest.cmake.in @@ -36,6 +36,8 @@ set(TIMESTAMP-IncompleteSpecifier-RESULT 0) set(TIMESTAMP-IncompleteSpecifier-STDERR "~foobar%~") set(TIMESTAMP-AllSpecifiers-RESULT 0) set(TIMESTAMP-AllSpecifiers-STDERR "~[0-9]+(;[0-9]+)*~") +set(TIMESTAMP-MonthWeekNames-RESULT 0) +set(TIMESTAMP-MonthWeekNames-STDERR "~[^%]+;[^%]+~") set(TIMESTAMP-UnixTime-RESULT 0) set(TIMESTAMP-UnixTime-STDERR "~[1-9][0-9]+~") @@ -60,6 +62,7 @@ check_cmake_test(String TIMESTAMP-UnknownSpecifier TIMESTAMP-IncompleteSpecifier TIMESTAMP-AllSpecifiers + TIMESTAMP-MonthWeekNames TIMESTAMP-UnixTime ) |