summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-17 14:40:54 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-11-17 14:40:54 (GMT)
commit033ed9a5942e789c11130c325db487831dc417a9 (patch)
treed576dfabc133a0e5cbb95ce567f82ec3b46c847c /Tests/RunCMake
parente943fa8a19a1fbe190e6fe0591d2b509e07b9878 (diff)
parent39baf728b78bfc5ae99258fc8db1c467f01b9ae4 (diff)
downloadCMake-033ed9a5942e789c11130c325db487831dc417a9.zip
CMake-033ed9a5942e789c11130c325db487831dc417a9.tar.gz
CMake-033ed9a5942e789c11130c325db487831dc417a9.tar.bz2
Merge topic 'test-custom-command-errors'
39baf728 Tests: Test add_custom_command and add_custom_target error cases
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/add_custom_command/AppendNoOutput-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/AppendNoOutput-stderr.txt4
-rw-r--r--Tests/RunCMake/add_custom_command/AppendNoOutput.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/AppendNotOutput-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt5
-rw-r--r--Tests/RunCMake/add_custom_command/AppendNotOutput.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/BadArgument-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/BadArgument-stderr.txt4
-rw-r--r--Tests/RunCMake/add_custom_command/BadArgument.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/add_custom_command/NoArguments-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/NoArguments-stderr.txt4
-rw-r--r--Tests/RunCMake/add_custom_command/NoArguments.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/NoOutputOrTarget-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/NoOutputOrTarget-stderr.txt4
-rw-r--r--Tests/RunCMake/add_custom_command/NoOutputOrTarget.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/OutputAndTarget-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/OutputAndTarget-stderr.txt5
-rw-r--r--Tests/RunCMake/add_custom_command/OutputAndTarget.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/RunCMakeTest.cmake8
-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
29 files changed, 85 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index a99b46f..c5825fe 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -95,6 +95,8 @@ endif()
add_RunCMake_test(CompatibleInterface)
add_RunCMake_test(Syntax)
+add_RunCMake_test(add_custom_command)
+add_RunCMake_test(add_custom_target)
add_RunCMake_test(add_dependencies)
add_RunCMake_test(build_command)
add_RunCMake_test(export)
diff --git a/Tests/RunCMake/add_custom_command/AppendNoOutput-result.txt b/Tests/RunCMake/add_custom_command/AppendNoOutput-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendNoOutput-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/AppendNoOutput-stderr.txt b/Tests/RunCMake/add_custom_command/AppendNoOutput-stderr.txt
new file mode 100644
index 0000000..abbfc5a
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendNoOutput-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at AppendNoOutput.cmake:1 \(add_custom_command\):
+ add_custom_command given APPEND option with no OUTPUT.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/AppendNoOutput.cmake b/Tests/RunCMake/add_custom_command/AppendNoOutput.cmake
new file mode 100644
index 0000000..c6c716b
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendNoOutput.cmake
@@ -0,0 +1 @@
+add_custom_command(TARGET x APPEND DEPENDS a b c d)
diff --git a/Tests/RunCMake/add_custom_command/AppendNotOutput-result.txt b/Tests/RunCMake/add_custom_command/AppendNotOutput-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendNotOutput-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
new file mode 100644
index 0000000..96d0972
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
+ add_custom_command given APPEND option with output.*
+ which is not already a custom command output.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/AppendNotOutput.cmake b/Tests/RunCMake/add_custom_command/AppendNotOutput.cmake
new file mode 100644
index 0000000..cc16129
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendNotOutput.cmake
@@ -0,0 +1 @@
+add_custom_command(OUTPUT out APPEND DEPENDS dep)
diff --git a/Tests/RunCMake/add_custom_command/BadArgument-result.txt b/Tests/RunCMake/add_custom_command/BadArgument-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadArgument-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/BadArgument-stderr.txt b/Tests/RunCMake/add_custom_command/BadArgument-stderr.txt
new file mode 100644
index 0000000..04c5350
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadArgument-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at BadArgument.cmake:1 \(add_custom_command\):
+ add_custom_command Wrong syntax. Unknown type of argument.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/BadArgument.cmake b/Tests/RunCMake/add_custom_command/BadArgument.cmake
new file mode 100644
index 0000000..d9e7bd4
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadArgument.cmake
@@ -0,0 +1 @@
+add_custom_command(bad_arg OUTPUT a b c d)
diff --git a/Tests/RunCMake/add_custom_command/CMakeLists.txt b/Tests/RunCMake/add_custom_command/CMakeLists.txt
new file mode 100644
index 0000000..ef2163c
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/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_command/NoArguments-result.txt b/Tests/RunCMake/add_custom_command/NoArguments-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/NoArguments-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/NoArguments-stderr.txt b/Tests/RunCMake/add_custom_command/NoArguments-stderr.txt
new file mode 100644
index 0000000..11e0cb0
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/NoArguments-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoArguments.cmake:1 \(add_custom_command\):
+ add_custom_command called with wrong number of arguments.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/NoArguments.cmake b/Tests/RunCMake/add_custom_command/NoArguments.cmake
new file mode 100644
index 0000000..8781a87
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/NoArguments.cmake
@@ -0,0 +1 @@
+add_custom_command()
diff --git a/Tests/RunCMake/add_custom_command/NoOutputOrTarget-result.txt b/Tests/RunCMake/add_custom_command/NoOutputOrTarget-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/NoOutputOrTarget-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/NoOutputOrTarget-stderr.txt b/Tests/RunCMake/add_custom_command/NoOutputOrTarget-stderr.txt
new file mode 100644
index 0000000..6a5c0a3
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/NoOutputOrTarget-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoOutputOrTarget.cmake:1 \(add_custom_command\):
+ add_custom_command Wrong syntax. A TARGET or OUTPUT must be specified.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/NoOutputOrTarget.cmake b/Tests/RunCMake/add_custom_command/NoOutputOrTarget.cmake
new file mode 100644
index 0000000..933ee32
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/NoOutputOrTarget.cmake
@@ -0,0 +1 @@
+add_custom_command(COMMAND echo a b c d)
diff --git a/Tests/RunCMake/add_custom_command/OutputAndTarget-result.txt b/Tests/RunCMake/add_custom_command/OutputAndTarget-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/OutputAndTarget-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/OutputAndTarget-stderr.txt b/Tests/RunCMake/add_custom_command/OutputAndTarget-stderr.txt
new file mode 100644
index 0000000..632880e
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/OutputAndTarget-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at OutputAndTarget.cmake:1 \(add_custom_command\):
+ add_custom_command Wrong syntax. A TARGET and OUTPUT can not both be
+ specified.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/OutputAndTarget.cmake b/Tests/RunCMake/add_custom_command/OutputAndTarget.cmake
new file mode 100644
index 0000000..55806f3
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/OutputAndTarget.cmake
@@ -0,0 +1 @@
+add_custom_command(OUTPUT out TARGET target)
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
new file mode 100644
index 0000000..a692600
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(AppendNoOutput)
+run_cmake(AppendNotOutput)
+run_cmake(BadArgument)
+run_cmake(NoArguments)
+run_cmake(NoOutputOrTarget)
+run_cmake(OutputAndTarget)
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)