diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeTests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/CMakeTests/SeparateArgumentsTest.cmake.in | 25 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/separate_arguments/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/separate_arguments/EmptyCommand.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/separate_arguments/PlainCommand.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/separate_arguments/RunCMakeTest.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/separate_arguments/UnixCommand.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/separate_arguments/WindowsCommand.cmake | 8 |
9 files changed, 40 insertions, 26 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index 1cca35d..1619081 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -19,7 +19,6 @@ AddCMakeTest(GetFilenameComponentRealpath "") AddCMakeTest(Version "") AddCMakeTest(Message "") AddCMakeTest(File "") -AddCMakeTest(SeparateArguments "") AddCMakeTest(ImplicitLinkInfo "") AddCMakeTest(ModuleNotices "") AddCMakeTest(GetProperty "") diff --git a/Tests/CMakeTests/SeparateArgumentsTest.cmake.in b/Tests/CMakeTests/SeparateArgumentsTest.cmake.in deleted file mode 100644 index 48964b8..0000000 --- a/Tests/CMakeTests/SeparateArgumentsTest.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -set(old_out "a b c") -separate_arguments(old_out) -set(old_exp "a;b;;c") - -set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"") -set(unix_exp "a;b c;d e;\;; '\";';\"") -separate_arguments(unix_out UNIX_COMMAND "${unix_cmd}") - -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}") - -foreach(mode old unix windows) - if(NOT "${${mode}_out}" STREQUAL "${${mode}_exp}") - message(FATAL_ERROR "separate_arguments ${mode}-style failed. " - "Expected\n [${${mode}_exp}]\nbut got\n [${${mode}_out}]\n") - endif() -endforeach() - -set(nothing) -separate_arguments(nothing) -if(DEFINED nothing) - message(FATAL_ERROR "separate_arguments null-case failed: " - "nothing=[${nothing}]") -endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7db5243..0e17bb3 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -216,6 +216,7 @@ add_RunCMake_test(list) add_RunCMake_test(message) add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES}) add_RunCMake_test(return) +add_RunCMake_test(separate_arguments) add_RunCMake_test(set_property) add_RunCMake_test(string) foreach(var 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() |