summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-21 15:38:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-21 15:38:32 (GMT)
commit3c5d52579b271e99475873cec953a1ecccbea585 (patch)
tree170428cfc18854c7bd46e731631d8b0a75f1c119 /Tests
parent8526a8cdefad26f894bc47023a052ea9e8504a2a (diff)
parentaa55587094f833db511a8c6e2ba63748af7d1719 (diff)
downloadCMake-3c5d52579b271e99475873cec953a1ecccbea585.zip
CMake-3c5d52579b271e99475873cec953a1ecccbea585.tar.gz
CMake-3c5d52579b271e99475873cec953a1ecccbea585.tar.bz2
Merge topic 'cmake_command_invoke_expand_function_name'
aa55587094 cmake_command: Expand INVOKE function name argument Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4750
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/cmake_command/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name.cmake2
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments.cmake2
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-result.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-stderr.txt5
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code.cmake1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation.cmake2
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name.cmake2
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name.cmake11
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command.cmake6
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-result.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-stderr.txt4
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments.cmake2
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument.cmake2
21 files changed, 57 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
index 0f12b80..a6b2efe 100644
--- a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
@@ -2,11 +2,20 @@ include(RunCMake)
run_cmake(cmake_command_no_parameters)
run_cmake(cmake_command_unknown_meta_operation)
+run_cmake(cmake_command_invoke_double_evaluation)
+run_cmake(cmake_command_invoke_expanded_command)
+run_cmake(cmake_command_invoke_expanded_command_and_arguments)
+run_cmake(cmake_command_invoke_expanded_command_with_explicit_argument)
+run_cmake(cmake_command_invoke_expand_command_name)
+run_cmake(cmake_command_invoke_expand_function_name)
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_expand_command_name)
+run_cmake(cmake_command_eval_expanded_command_and_arguments)
+run_cmake(cmake_command_eval_extra_parameters_between_eval_and_code)
run_cmake(cmake_command_eval_message)
run_cmake(cmake_command_eval_message_fatal_error)
run_cmake(cmake_command_eval_no_code)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name-stderr.txt
new file mode 100644
index 0000000..d640661
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name.cmake
new file mode 100644
index 0000000..4cea393
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name.cmake
@@ -0,0 +1,2 @@
+set (my_eval "EVAL")
+cmake_command (${my_eval} CODE message("OK!"))
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments-stderr.txt
new file mode 100644
index 0000000..d640661
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments.cmake
new file mode 100644
index 0000000..fcc399b
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments.cmake
@@ -0,0 +1,2 @@
+set(cmd EVAL CODE [[message("OK!")]])
+cmake_command(${cmd})
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-result.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-stderr.txt
new file mode 100644
index 0000000..13c114e
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at cmake_command_eval_extra_parameters_between_eval_and_code.cmake:1 \(cmake_command\):
+ cmake_command called with unsupported arguments between EVAL and CODE
+ arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code.cmake
new file mode 100644
index 0000000..0927631
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code.cmake
@@ -0,0 +1 @@
+cmake_command(EVAL BAD CODE "message(BAD CODE)")
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation-stderr.txt
new file mode 100644
index 0000000..59a70bd
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation-stderr.txt
@@ -0,0 +1 @@
+var='\${foo}'
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation.cmake
new file mode 100644
index 0000000..10970fc
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation.cmake
@@ -0,0 +1,2 @@
+set(var [[${foo}]])
+cmake_command(INVOKE cmake_command INVOKE message "var='${var}'")
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name-stderr.txt
new file mode 100644
index 0000000..d640661
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name.cmake
new file mode 100644
index 0000000..d59afe4
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name.cmake
@@ -0,0 +1,2 @@
+set (my_invoke "INVOKE")
+cmake_command (${my_invoke} message "OK!")
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name-stderr.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name-stderr.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name.cmake
new file mode 100644
index 0000000..923ddaa
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name.cmake
@@ -0,0 +1,11 @@
+function(some_function_1)
+ message(1)
+endfunction()
+
+function(some_function_2)
+ message(2)
+endfunction()
+
+set(function_version 1)
+
+cmake_command(INVOKE some_function_${function_version})
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command-stderr.txt
new file mode 100644
index 0000000..d640661
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command.cmake
new file mode 100644
index 0000000..bca7d2f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command.cmake
@@ -0,0 +1,6 @@
+function (itsok)
+ message(OK!)
+endfunction()
+
+set (cmd INVOKE itsok)
+cmake_command (${cmd})
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-result.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-stderr.txt
new file mode 100644
index 0000000..6d0e241
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at cmake_command_invoke_expanded_command_and_arguments.cmake:2 \(cmake_command\):
+ cmake_command called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments.cmake
new file mode 100644
index 0000000..6bfa3a7
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments.cmake
@@ -0,0 +1,2 @@
+set(invoke_message INVOKE message a b)
+cmake_command(${invoke_message})
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument-stderr.txt
new file mode 100644
index 0000000..d640661
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument.cmake
new file mode 100644
index 0000000..eb0411f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument.cmake
@@ -0,0 +1,2 @@
+set (cmd INVOKE message)
+cmake_command (${cmd} "OK!")