diff options
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/string/Repeat.cmake | 45 | ||||
-rw-r--r-- | Tests/RunCMake/string/RepeatNegativeCount-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/string/RepeatNegativeCount-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/string/RepeatNegativeCount.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/string/RepeatNoArgs-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/string/RepeatNoArgs-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/string/RepeatNoArgs.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/string/RunCMakeTest.cmake | 4 |
8 files changed, 61 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/Repeat.cmake b/Tests/RunCMake/string/Repeat.cmake new file mode 100644 index 0000000..fc390aa --- /dev/null +++ b/Tests/RunCMake/string/Repeat.cmake @@ -0,0 +1,45 @@ +string(REPEAT "q" 4 q_out) + +if(NOT DEFINED q_out) + message(FATAL_ERROR "q_out is not defined") +endif() + +if(NOT q_out STREQUAL "qqqq") + message(FATAL_ERROR "unexpected result") +endif() + +string(REPEAT "1234" 0 zero_out) + +if(NOT DEFINED zero_out) + message(FATAL_ERROR "zero_out is not defined") +endif() + +if(NOT zero_out STREQUAL "") + message(FATAL_ERROR "unexpected result") +endif() + +unset(zero_out) + +string(REPEAT "" 100 zero_out) + +if(NOT DEFINED zero_out) + message(FATAL_ERROR "zero_out is not defined") +endif() + +if(NOT zero_out STREQUAL "") + message(FATAL_ERROR "unexpected result") +endif() + +string(REPEAT "1" 1 one_out) + +if(NOT one_out STREQUAL "1") + message(FATAL_ERROR "unexpected result") +endif() + +unset(one_out) + +string(REPEAT "one" 1 one_out) + +if(NOT one_out STREQUAL "one") + message(FATAL_ERROR "unexpected result") +endif() diff --git a/Tests/RunCMake/string/RepeatNegativeCount-result.txt b/Tests/RunCMake/string/RepeatNegativeCount-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/RepeatNegativeCount-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/RepeatNegativeCount-stderr.txt b/Tests/RunCMake/string/RepeatNegativeCount-stderr.txt new file mode 100644 index 0000000..bbd498e --- /dev/null +++ b/Tests/RunCMake/string/RepeatNegativeCount-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at RepeatNegativeCount.cmake:[0-9]+ \(string\): + repeat count is not a positive number. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/RepeatNegativeCount.cmake b/Tests/RunCMake/string/RepeatNegativeCount.cmake new file mode 100644 index 0000000..769e7c0 --- /dev/null +++ b/Tests/RunCMake/string/RepeatNegativeCount.cmake @@ -0,0 +1 @@ +string(REPEAT "blah" -1 out) diff --git a/Tests/RunCMake/string/RepeatNoArgs-result.txt b/Tests/RunCMake/string/RepeatNoArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/RepeatNoArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/RepeatNoArgs-stderr.txt b/Tests/RunCMake/string/RepeatNoArgs-stderr.txt new file mode 100644 index 0000000..5abcb3b --- /dev/null +++ b/Tests/RunCMake/string/RepeatNoArgs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at RepeatNoArgs.cmake:[0-9]+ \(string\): + sub-command REPEAT requires three arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/RepeatNoArgs.cmake b/Tests/RunCMake/string/RepeatNoArgs.cmake new file mode 100644 index 0000000..e327e99 --- /dev/null +++ b/Tests/RunCMake/string/RepeatNoArgs.cmake @@ -0,0 +1 @@ +string(REPEAT) diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake index 211337a..c432b4e 100644 --- a/Tests/RunCMake/string/RunCMakeTest.cmake +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -33,3 +33,7 @@ run_cmake(UTF-16BE) run_cmake(UTF-16LE) run_cmake(UTF-32BE) run_cmake(UTF-32LE) + +run_cmake(Repeat) +run_cmake(RepeatNoArgs) +run_cmake(RepeatNegativeCount) |