summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-03 14:19:31 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-03-03 14:19:39 (GMT)
commit38ac070eada4abb9786968b2f88f7d0d8874770c (patch)
tree9442acbf5aef60f6dc8105fc64d95c0138dacf7f /Tests
parentcabde33ed87a127416ac40278d4c4ead21767c6e (diff)
parent598b676b5e77540b366b01b3c10154c2a633d23c (diff)
downloadCMake-38ac070eada4abb9786968b2f88f7d0d8874770c.zip
CMake-38ac070eada4abb9786968b2f88f7d0d8874770c.tar.gz
CMake-38ac070eada4abb9786968b2f88f7d0d8874770c.tar.bz2
Merge topic 'cmake_command-eval'
598b676b5e cmake_command: Add command to EVAL a CMake script as a string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4408
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Syntax/CommandEOF-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_command/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt5
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake5
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake2
15 files changed, 30 insertions, 1 deletions
diff --git a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
index 31cbc08..b9f8fd1 100644
--- a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
+++ b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Error in CommandEOF.cmake:
+^CMake Error at CommandEOF.cmake:1:
Unexpected end of file.
Parse error. Function missing opening "\(".
diff --git a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
index d338cd8..2b6e7a2 100644
--- a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake
@@ -6,3 +6,8 @@ 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_unknown_function)
+run_cmake(cmake_command_eval_message)
+run_cmake(cmake_command_eval_message_fatal_error)
+run_cmake(cmake_command_eval_no_code)
+run_cmake(cmake_command_eval_no_parameters)
+run_cmake(cmake_command_eval_variable_outside_message)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt
new file mode 100644
index 0000000..cfc8694
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt
@@ -0,0 +1 @@
+WORKS!
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake
new file mode 100644
index 0000000..9ef5e25
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake
@@ -0,0 +1 @@
+cmake_command(EVAL CODE message(WORKS!))
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt
new file mode 100644
index 0000000..6a8a124
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at cmake_command_eval_message_fatal_error.cmake:1:EVAL:2 \(message\):
+ error!
+Call Stack \(most recent call first\):
+ cmake_command_eval_message_fatal_error.cmake:1 \(cmake_command\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake
new file mode 100644
index 0000000..22913de
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake
@@ -0,0 +1,5 @@
+cmake_command(EVAL CODE
+"
+ message(FATAL_ERROR error!)
+"
+)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt
new file mode 100644
index 0000000..ee53312
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at cmake_command_eval_no_code.cmake:1 \(cmake_command\):
+ cmake_command called without CODE argument
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake
new file mode 100644
index 0000000..22e1667
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake
@@ -0,0 +1 @@
+cmake_command(EVAL message "too many parameters")
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt
new file mode 100644
index 0000000..e9fc317
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at cmake_command_eval_no_parameters.cmake:1 \(cmake_command\):
+ cmake_command called with incorrect number of arguments
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake
new file mode 100644
index 0000000..a5ba2c7
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake
@@ -0,0 +1 @@
+cmake_command(EVAL)
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt
new file mode 100644
index 0000000..cfc8694
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt
@@ -0,0 +1 @@
+WORKS!
diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake
new file mode 100644
index 0000000..b7a06a5
--- /dev/null
+++ b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake
@@ -0,0 +1,2 @@
+cmake_command(EVAL CODE "set(phrase \"WORKS!\")")
+message(${phrase})