diff options
author | Brad King <brad.king@kitware.com> | 2013-10-22 13:08:15 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-22 13:08:15 (GMT) |
commit | 7809adb8145ce0d1831dc34c49f1406ad7fa68ad (patch) | |
tree | 22a1b7cd6e577749e35aa0028860dfcecbb0f243 /Tests | |
parent | c9518497997845306b2d1127fbd7acf4e6081fe8 (diff) | |
parent | 4e184a21beda9de3703ecda94085c234f5bbd7da (diff) | |
download | CMake-7809adb8145ce0d1831dc34c49f1406ad7fa68ad.zip CMake-7809adb8145ce0d1831dc34c49f1406ad7fa68ad.tar.gz CMake-7809adb8145ce0d1831dc34c49f1406ad7fa68ad.tar.bz2 |
Merge topic 'string-CONCAT-command'
4e184a2 string: Add CONCAT sub-command
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/string/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/string/Concat.cmake | 19 | ||||
-rw-r--r-- | Tests/RunCMake/string/ConcatNoArgs-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/string/ConcatNoArgs-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/string/ConcatNoArgs.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/string/RunCMakeTest.cmake | 4 |
7 files changed, 33 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 460732c..3a0ea91 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -99,6 +99,7 @@ add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) add_RunCMake_test(message) +add_RunCMake_test(string) add_RunCMake_test(try_compile) add_RunCMake_test(variable_watch) add_RunCMake_test(CMP0004) diff --git a/Tests/RunCMake/string/CMakeLists.txt b/Tests/RunCMake/string/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/string/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/string/Concat.cmake b/Tests/RunCMake/string/Concat.cmake new file mode 100644 index 0000000..7260c95 --- /dev/null +++ b/Tests/RunCMake/string/Concat.cmake @@ -0,0 +1,19 @@ +set(b b) +set(out x) +string(CONCAT out) +if(NOT out STREQUAL "") + message(FATAL_ERROR "\"string(CONCAT out)\" set out to \"${out}\"") +endif() +string(CONCAT out a) +if(NOT out STREQUAL "a") + message(FATAL_ERROR "\"string(CONCAT out a)\" set out to \"${out}\"") +endif() +string(CONCAT out a "b") +if(NOT out STREQUAL "ab") + message(FATAL_ERROR "\"string(CONCAT out a \"b\")\" set out to \"${out}\"") +endif() +string(CONCAT out a "${b}" [[ +${c}]]) +if(NOT out STREQUAL "ab\${c}") + message(FATAL_ERROR "\"string(CONCAT out a \"\${b}\" [[\${c}]])\" set out to \"${out}\"") +endif() diff --git a/Tests/RunCMake/string/ConcatNoArgs-result.txt b/Tests/RunCMake/string/ConcatNoArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/ConcatNoArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/ConcatNoArgs-stderr.txt b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt new file mode 100644 index 0000000..efea5f1 --- /dev/null +++ b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at ConcatNoArgs.cmake:1 \(string\): + string sub-command CONCAT requires at least one argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/ConcatNoArgs.cmake b/Tests/RunCMake/string/ConcatNoArgs.cmake new file mode 100644 index 0000000..ba21136 --- /dev/null +++ b/Tests/RunCMake/string/ConcatNoArgs.cmake @@ -0,0 +1 @@ +string(CONCAT) diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake new file mode 100644 index 0000000..501acd2 --- /dev/null +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(Concat) +run_cmake(ConcatNoArgs) |