summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-23 20:18:36 (GMT)
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-23 20:18:36 (GMT)
commita1cc6b4447787b84777fdf9a860e8c39f0f4a090 (patch)
tree2c6bda9df6651b5732f6eef005333c15a3d07d65 /Tests
parentcbb861ade85e3b7e550bb1f150513b237efc1f02 (diff)
downloadCMake-a1cc6b4447787b84777fdf9a860e8c39f0f4a090.zip
CMake-a1cc6b4447787b84777fdf9a860e8c39f0f4a090.tar.gz
CMake-a1cc6b4447787b84777fdf9a860e8c39f0f4a090.tar.bz2
add_custom_target: Add output checks for custom target byproducts
Use the output checks for byproducts of add_custom_command also for byproducts of add_custom_target.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt16
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt36
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct.cmake6
-rw-r--r--Tests/RunCMake/add_custom_target/RunCMakeTest.cmake7
5 files changed, 55 insertions, 11 deletions
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
index 6315c8b..97b9cca 100644
--- a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
@@ -1,27 +1,27 @@
CMake Error at BadByproduct.cmake:2 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a "#". This character is
- not allowed.
+ add_custom_command called with BYPRODUCTS 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.
+ add_custom_command called with BYPRODUCTS 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.
+ add_custom_command called with BYPRODUCTS 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.
+ add_custom_command called with BYPRODUCTS containing a "<". This character
+ is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-result.txt b/Tests/RunCMake/add_custom_target/BadByproduct-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadByproduct-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
new file mode 100644
index 0000000..7390e6a
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
@@ -0,0 +1,36 @@
+CMake Error at BadByproduct.cmake:2 \(add_custom_target\):
+ add_custom_target called with BYPRODUCTS 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_target\):
+ add_custom_target called with BYPRODUCTS 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_target\):
+ add_custom_target called with BYPRODUCTS 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_target\):
+ add_custom_target called with BYPRODUCTS 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_target\):
+ add_custom_target attempted to have a file
+
+ .*/j".*
+
+ 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_target/BadByproduct.cmake b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
new file mode 100644
index 0000000..963d641
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
@@ -0,0 +1,6 @@
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+add_custom_target(a BYPRODUCTS "a#" COMMAND b)
+add_custom_target(c BYPRODUCTS "a<" COMMAND d)
+add_custom_target(e BYPRODUCTS "a>" COMMAND f)
+add_custom_target(g BYPRODUCTS "$<CONFIG>/#" COMMAND h)
+add_custom_target(i BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/j COMMAND k)
diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
index 49c7d3e..f5d5dd2 100644
--- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
@@ -1,11 +1,12 @@
include(RunCMake)
-run_cmake(CommandExpandsEmpty)
-run_cmake(GeneratedProperty)
-run_cmake(NoArguments)
+run_cmake(BadByproduct)
run_cmake(BadTargetName)
run_cmake(ByproductsNoCommand)
+run_cmake(CommandExpandsEmpty)
+run_cmake(GeneratedProperty)
run_cmake(LiteralQuotes)
+run_cmake(NoArguments)
run_cmake(UsesTerminalNoCommand)
function(run_TargetOrder)