diff options
author | Christian Pfeiffer <cpfeiffer@live.de> | 2017-04-26 18:26:47 (GMT) |
---|---|---|
committer | Christian Pfeiffer <cpfeiffer@live.de> | 2017-04-26 18:26:47 (GMT) |
commit | 81841426fc12864008999893c11e555df06df292 (patch) | |
tree | 2d7f1c48f8e75c2eb1ea64a87ffb061367cb9469 /Tests/RunCMake/separate_arguments | |
parent | 41b84b2220ef147d76f5b1291601c069397f854b (diff) | |
download | CMake-81841426fc12864008999893c11e555df06df292.zip CMake-81841426fc12864008999893c11e555df06df292.tar.gz CMake-81841426fc12864008999893c11e555df06df292.tar.bz2 |
separgs: Migrate tests to RunCMake tests
Diffstat (limited to 'Tests/RunCMake/separate_arguments')
6 files changed, 39 insertions, 0 deletions
diff --git a/Tests/RunCMake/separate_arguments/CMakeLists.txt b/Tests/RunCMake/separate_arguments/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/separate_arguments/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/separate_arguments/EmptyCommand.cmake b/Tests/RunCMake/separate_arguments/EmptyCommand.cmake new file mode 100644 index 0000000..895b6ac --- /dev/null +++ b/Tests/RunCMake/separate_arguments/EmptyCommand.cmake @@ -0,0 +1,6 @@ +set(nothing) +separate_arguments(nothing) +if(DEFINED nothing) + message(FATAL_ERROR "separate_arguments null-case failed: " + "nothing=[${nothing}]") +endif() diff --git a/Tests/RunCMake/separate_arguments/PlainCommand.cmake b/Tests/RunCMake/separate_arguments/PlainCommand.cmake new file mode 100644 index 0000000..311a993 --- /dev/null +++ b/Tests/RunCMake/separate_arguments/PlainCommand.cmake @@ -0,0 +1,8 @@ +set(old_out "a b c") +separate_arguments(old_out) +set(old_exp "a;b;;c") + +if(NOT "${old_out}" STREQUAL "${old_exp}") + message(FATAL_ERROR "separate_arguments old-style failed. " + "Expected\n [${old_exp}]\nbut got\n [${old_out}]\n") +endif() diff --git a/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake b/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake new file mode 100644 index 0000000..0917d87 --- /dev/null +++ b/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake @@ -0,0 +1,6 @@ +include(RunCMake) + +run_cmake(EmptyCommand) +run_cmake(PlainCommand) +run_cmake(UnixCommand) +run_cmake(WindowsCommand) diff --git a/Tests/RunCMake/separate_arguments/UnixCommand.cmake b/Tests/RunCMake/separate_arguments/UnixCommand.cmake new file mode 100644 index 0000000..0b5767a --- /dev/null +++ b/Tests/RunCMake/separate_arguments/UnixCommand.cmake @@ -0,0 +1,8 @@ +set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"") +set(unix_exp "a;b c;d e;\;; '\";';\"") +separate_arguments(unix_out UNIX_COMMAND "${unix_cmd}") + +if(NOT "${unix_out}" STREQUAL "${unix_exp}") + message(FATAL_ERROR "separate_arguments unix-style failed. " + "Expected\n [${unix_exp}]\nbut got\n [${unix_out}]\n") +endif() diff --git a/Tests/RunCMake/separate_arguments/WindowsCommand.cmake b/Tests/RunCMake/separate_arguments/WindowsCommand.cmake new file mode 100644 index 0000000..86aa14a --- /dev/null +++ b/Tests/RunCMake/separate_arguments/WindowsCommand.cmake @@ -0,0 +1,8 @@ +set(windows_cmd "a \"b c\" 'd e' \";\" \\ \"c:\\windows\\path\\\\\" \\\"") +set(windows_exp "a;b c;'d;e';\;;\\;c:\\windows\\path\\;\"") +separate_arguments(windows_out WINDOWS_COMMAND "${windows_cmd}") + +if(NOT "${windows_out}" STREQUAL "${windows_exp}") + message(FATAL_ERROR "separate_arguments windows-style failed. " + "Expected\n [${windows_exp}]\nbut got\n [${windows_out}]\n") +endif() |