summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-20 14:22:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-20 14:24:32 (GMT)
commit541e681da26d3f264ad20228b66e6cfdfec83878 (patch)
tree50aad156a86eca7b4d8f76fef9c785d926957e50 /Tests/RunCMake
parentfb8341c35e43d605e4d2ece50dad6428fd9cc45d (diff)
parent0e1faa28cbd12d400b876f7a21d91aad5a837196 (diff)
downloadCMake-541e681da26d3f264ad20228b66e6cfdfec83878.zip
CMake-541e681da26d3f264ad20228b66e6cfdfec83878.tar.gz
CMake-541e681da26d3f264ad20228b66e6cfdfec83878.tar.bz2
Merge topic 'split-custom-command-creation'
0e1faa28cb cmMakefile: Separate custom command setup from actual creation 56c204e8eb cmMakefile: Refactor AddCustomCommandOldStyle to be delay friendly 3061dc6ac9 add_custom_command: Add tests for rejecting literal quotes in commands e893ab94ba cmMakefile: Validate command line for all custom commands f1e846fdde cmMakefile: Extract custom command validation method 4926ab2454 cmMakefile: Create all generated byproducts as known sources Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3822
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake2
-rw-r--r--Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_command/LiteralQuotes.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake2
-rw-r--r--Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_target/LiteralQuotes.cmake1
-rw-r--r--Tests/RunCMake/add_custom_target/RunCMakeTest.cmake1
14 files changed, 42 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt
new file mode 100644
index 0000000..503385f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at AppendLiteralQuotes.cmake:2 \(add_custom_command\):
+ COMMAND may not contain literal quotes:
+
+ "c"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake
new file mode 100644
index 0000000..038fb3f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake
@@ -0,0 +1,2 @@
+add_custom_command(OUTPUT a COMMAND b)
+add_custom_command(OUTPUT a COMMAND "\"c\"" APPEND)
diff --git a/Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt b/Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt
new file mode 100644
index 0000000..e7d6155
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at LiteralQuotes.cmake:1 \(add_custom_command\):
+ COMMAND may not contain literal quotes:
+
+ "b"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/LiteralQuotes.cmake b/Tests/RunCMake/add_custom_command/LiteralQuotes.cmake
new file mode 100644
index 0000000..046ddd9
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/LiteralQuotes.cmake
@@ -0,0 +1 @@
+add_custom_command(OUTPUT a COMMAND "\"b\"")
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
index 20097b7..270df2f 100644
--- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -1,15 +1,18 @@
include(RunCMake)
+run_cmake(AppendLiteralQuotes)
run_cmake(AppendNoOutput)
run_cmake(AppendNotOutput)
run_cmake(BadArgument)
run_cmake(GeneratedProperty)
+run_cmake(LiteralQuotes)
run_cmake(NoArguments)
run_cmake(NoOutputOrTarget)
run_cmake(OutputAndTarget)
run_cmake(SourceByproducts)
run_cmake(SourceUsesTerminal)
run_cmake(TargetImported)
+run_cmake(TargetLiteralQuotes)
run_cmake(TargetNotInDir)
if(${RunCMake_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])")
diff --git a/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt
new file mode 100644
index 0000000..c4589b4
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at TargetLiteralQuotes.cmake:2 \(add_custom_command\):
+ COMMAND may not contain literal quotes:
+
+ "b"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake
new file mode 100644
index 0000000..5f11ed1
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake
@@ -0,0 +1,2 @@
+add_library(a)
+add_custom_command(TARGET a POST_BUILD COMMAND "\"b\"")
diff --git a/Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt b/Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt
new file mode 100644
index 0000000..bc5187a
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at LiteralQuotes.cmake:1 \(add_custom_target\):
+ COMMAND may not contain literal quotes:
+
+ "b"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_target/LiteralQuotes.cmake b/Tests/RunCMake/add_custom_target/LiteralQuotes.cmake
new file mode 100644
index 0000000..9870608
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/LiteralQuotes.cmake
@@ -0,0 +1 @@
+add_custom_target(a COMMAND "\"b\"")
diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
index d80ca19..49c7d3e 100644
--- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
@@ -5,6 +5,7 @@ run_cmake(GeneratedProperty)
run_cmake(NoArguments)
run_cmake(BadTargetName)
run_cmake(ByproductsNoCommand)
+run_cmake(LiteralQuotes)
run_cmake(UsesTerminalNoCommand)
function(run_TargetOrder)