summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-05-12 19:19:31 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2020-05-12 20:25:29 (GMT)
commit549599bf324ac58b0b27f6ba3849806dfa65fc93 (patch)
tree50c3f4658ca601d8a013683fd7deeedea8eb7d5b /Tests/RunCMake
parent4dc95526868d903c7f9e9505001cb5dbeec259c0 (diff)
downloadCMake-549599bf324ac58b0b27f6ba3849806dfa65fc93.zip
CMake-549599bf324ac58b0b27f6ba3849806dfa65fc93.tar.gz
CMake-549599bf324ac58b0b27f6ba3849806dfa65fc93.tar.bz2
cmake_command: Preserve arguments to INVOKE function
Fixes: #20630
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/cmake_command/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt6
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake12
3 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
index 2b6e7a2..0f12b80 100644
--- a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
@@ -5,6 +5,7 @@ run_cmake(cmake_command_unknown_meta_operation)
run_cmake(cmake_command_invoke_message)
run_cmake(cmake_command_invoke_message_fatal_error)
run_cmake(cmake_command_invoke_no_parameters)
+run_cmake(cmake_command_invoke_preserve_arguments)
run_cmake(cmake_command_invoke_unknown_function)
run_cmake(cmake_command_eval_message)
run_cmake(cmake_command_eval_message_fatal_error)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt
new file mode 100644
index 0000000..4670e60
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt
@@ -0,0 +1,6 @@
+foo\(...\)
+\[a;b\]
+\[c;d\]
+cmake_command\(INVOKE foo ...\)
+\[a;b\]
+\[c;d\]
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake
new file mode 100644
index 0000000..53ac2e6
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake
@@ -0,0 +1,12 @@
+function(foo arg1 arg2)
+ math(EXPR last "${ARGC} - 1")
+ foreach(i RANGE 0 ${last})
+ message("[${ARGV${i}}]")
+ endforeach()
+endfunction()
+
+message("foo(...)")
+foo("a;b" "c;d")
+
+message("cmake_command(INVOKE foo ...)")
+cmake_command(INVOKE foo "a;b" "c;d")