summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/separate_arguments
diff options
context:
space:
mode:
authorChristian Pfeiffer <cpfeiffer@live.de>2017-04-26 18:34:06 (GMT)
committerChristian Pfeiffer <cpfeiffer@live.de>2017-04-26 18:34:06 (GMT)
commit2a207aaca1d8414624dd4cfe8fcb19d03fe84546 (patch)
tree1366f0906caef3d94cb289ea080e18006632c874 /Tests/RunCMake/separate_arguments
parent81841426fc12864008999893c11e555df06df292 (diff)
downloadCMake-2a207aaca1d8414624dd4cfe8fcb19d03fe84546.zip
CMake-2a207aaca1d8414624dd4cfe8fcb19d03fe84546.tar.gz
CMake-2a207aaca1d8414624dd4cfe8fcb19d03fe84546.tar.bz2
separgs: Add a NATIVE_COMMAND mode
Diffstat (limited to 'Tests/RunCMake/separate_arguments')
-rw-r--r--Tests/RunCMake/separate_arguments/NativeCommand.cmake19
-rw-r--r--Tests/RunCMake/separate_arguments/RunCMakeTest.cmake1
2 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/separate_arguments/NativeCommand.cmake b/Tests/RunCMake/separate_arguments/NativeCommand.cmake
new file mode 100644
index 0000000..1cb009e
--- /dev/null
+++ b/Tests/RunCMake/separate_arguments/NativeCommand.cmake
@@ -0,0 +1,19 @@
+set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"")
+set(unix_exp "a;b c;d e;\;; '\";';\"")
+
+set(windows_cmd "a \"b c\" 'd e' \";\" \\ \"c:\\windows\\path\\\\\" \\\"")
+set(windows_exp "a;b c;'d;e';\;;\\;c:\\windows\\path\\;\"")
+
+if(CMAKE_HOST_WIN32)
+ set(native_cmd "${windows_cmd}")
+ set(native_exp "${windows_exp}")
+else()
+ set(native_cmd "${unix_cmd}")
+ set(native_exp "${unix_exp}")
+endif()
+separate_arguments(native_out NATIVE_COMMAND "${native_cmd}")
+
+if(NOT "${native_out}" STREQUAL "${native_exp}")
+ message(FATAL_ERROR "separate_arguments native-style failed. "
+ "Expected\n [${native_exp}]\nbut got\n [${native_out}]\n")
+endif()
diff --git a/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake b/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake
index 0917d87..07951bb 100644
--- a/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake
+++ b/Tests/RunCMake/separate_arguments/RunCMakeTest.cmake
@@ -4,3 +4,4 @@ run_cmake(EmptyCommand)
run_cmake(PlainCommand)
run_cmake(UnixCommand)
run_cmake(WindowsCommand)
+run_cmake(NativeCommand)