summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-21 15:16:36 +0200
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-23 22:15:31 +0200
commitcbb861ade85e3b7e550bb1f150513b237efc1f02 (patch)
tree92e13c7297a6a474f3a56d51acf99444dd7221f8 /Tests
parentebb9346490741ddc2ce6f552bc1be57dfc730cfa (diff)
downloadcmake-cbb861ade85e3b7e550bb1f150513b237efc1f02.tar.gz
add_custom_command: Add tests for custom command output checks
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt36
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct.cmake6
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput-stderr.txt36
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput.cmake6
-rw-r--r--Tests/RunCMake/add_custom_command/RunCMakeTest.cmake2
7 files changed, 88 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-result.txt b/Tests/RunCMake/add_custom_command/BadByproduct-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadByproduct-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
new file mode 100644
index 0000000000..6315c8bd9e
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
@@ -0,0 +1,36 @@
+CMake Error at BadByproduct.cmake:2 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "#". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:3 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "<". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:4 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a ">". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:5 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "<". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:6 \(add_custom_command\):
+ add_custom_command attempted to have a file
+
+ .*/f".*
+
+ in a source directory as an output of custom command.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct.cmake b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
new file mode 100644
index 0000000000..91bca52204
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
@@ -0,0 +1,6 @@
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+add_custom_command(OUTPUT a BYPRODUCTS "a#")
+add_custom_command(OUTPUT b BYPRODUCTS "a<")
+add_custom_command(OUTPUT c BYPRODUCTS "a>")
+add_custom_command(OUTPUT d BYPRODUCTS "$<CONFIG>/#")
+add_custom_command(OUTPUT e BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/f)
diff --git a/Tests/RunCMake/add_custom_command/BadOutput-result.txt b/Tests/RunCMake/add_custom_command/BadOutput-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadOutput-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
new file mode 100644
index 0000000000..584aa88ce8
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
@@ -0,0 +1,36 @@
+CMake Error at BadOutput.cmake:2 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "#". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:3 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "<". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:4 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a ">". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:5 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "<". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:6 \(add_custom_command\):
+ add_custom_command attempted to have a file
+
+ .*/e".*
+
+ in a source directory as an output of custom command.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/BadOutput.cmake b/Tests/RunCMake/add_custom_command/BadOutput.cmake
new file mode 100644
index 0000000000..6875fe966d
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadOutput.cmake
@@ -0,0 +1,6 @@
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+add_custom_command(OUTPUT "a#" COMMAND a)
+add_custom_command(OUTPUT "a<" COMMAND b)
+add_custom_command(OUTPUT "a>" COMMAND c)
+add_custom_command(OUTPUT "$<CONFIG>/#" COMMAND d)
+add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/e COMMAND f)
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
index 270df2fe95..96642faf1c 100644
--- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -4,6 +4,8 @@ run_cmake(AppendLiteralQuotes)
run_cmake(AppendNoOutput)
run_cmake(AppendNotOutput)
run_cmake(BadArgument)
+run_cmake(BadByproduct)
+run_cmake(BadOutput)
run_cmake(GeneratedProperty)
run_cmake(LiteralQuotes)
run_cmake(NoArguments)