summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/add_custom_command
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_command
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_command')
-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
20 files changed, 49 insertions, 0 deletions
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)