summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/add_custom_target
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-13 17:46:49 (GMT)
committerBrad King <brad.king@kitware.com>2014-11-14 16:43:35 (GMT)
commit39baf728b78bfc5ae99258fc8db1c467f01b9ae4 (patch)
tree38040cb1f0173915884bb456cd73e493c79896b9 /Tests/RunCMake/add_custom_target
parent0b3b54e21f5ab827d8073ad58de92e73d8688e6b (diff)
downloadCMake-39baf728b78bfc5ae99258fc8db1c467f01b9ae4.zip
CMake-39baf728b78bfc5ae99258fc8db1c467f01b9ae4.tar.gz
CMake-39baf728b78bfc5ae99258fc8db1c467f01b9ae4.tar.bz2
Tests: Test add_custom_command and add_custom_target error cases
Add RunCMake.add_custom_command and RunCMake.add_custom_target tests to cover the error messages for these commands.
Diffstat (limited to 'Tests/RunCMake/add_custom_target')
-rw-r--r--Tests/RunCMake/add_custom_target/BadTargetName-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt17
-rw-r--r--Tests/RunCMake/add_custom_target/BadTargetName.cmake3
-rw-r--r--Tests/RunCMake/add_custom_target/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/add_custom_target/NoArguments-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/NoArguments-stderr.txt4
-rw-r--r--Tests/RunCMake/add_custom_target/NoArguments.cmake1
-rw-r--r--Tests/RunCMake/add_custom_target/RunCMakeTest.cmake4
8 files changed, 34 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_custom_target/BadTargetName-result.txt b/Tests/RunCMake/add_custom_target/BadTargetName-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadTargetName-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt b/Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt
new file mode 100644
index 0000000..f352457
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadTargetName-stderr.txt
@@ -0,0 +1,17 @@
+CMake Error at BadTargetName.cmake:1 \(add_custom_target\):
+ add_custom_target called with target name containing a "#". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadTargetName.cmake:2 \(add_custom_target\):
+ add_custom_target called with target name containing a "<". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadTargetName.cmake:3 \(add_custom_target\):
+ add_custom_target called with target name 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/BadTargetName.cmake b/Tests/RunCMake/add_custom_target/BadTargetName.cmake
new file mode 100644
index 0000000..c4381a2
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadTargetName.cmake
@@ -0,0 +1,3 @@
+add_custom_target("#")
+add_custom_target("<")
+add_custom_target(">")
diff --git a/Tests/RunCMake/add_custom_target/CMakeLists.txt b/Tests/RunCMake/add_custom_target/CMakeLists.txt
new file mode 100644
index 0000000..ef2163c
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/add_custom_target/NoArguments-result.txt b/Tests/RunCMake/add_custom_target/NoArguments-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/NoArguments-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_target/NoArguments-stderr.txt b/Tests/RunCMake/add_custom_target/NoArguments-stderr.txt
new file mode 100644
index 0000000..2230093
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/NoArguments-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoArguments.cmake:1 \(add_custom_target\):
+ add_custom_target called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_target/NoArguments.cmake b/Tests/RunCMake/add_custom_target/NoArguments.cmake
new file mode 100644
index 0000000..ec6a212
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/NoArguments.cmake
@@ -0,0 +1 @@
+add_custom_target()
diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
new file mode 100644
index 0000000..4e4a8ae
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(NoArguments)
+run_cmake(BadTargetName)