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.
This commit is contained in:
parent
0b3b54e21f
commit
39baf728b7
|
@ -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)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1 @@
|
|||
add_custom_command(TARGET x APPEND DEPENDS a b c d)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1 @@
|
|||
add_custom_command(OUTPUT out APPEND DEPENDS dep)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1 @@
|
|||
add_custom_command(bad_arg OUTPUT a b c d)
|
|
@ -0,0 +1,3 @@
|
|||
cmake_minimum_required(VERSION 3.1)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1 @@
|
|||
add_custom_command()
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1 @@
|
|||
add_custom_command(COMMAND echo a b c d)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1 @@
|
|||
add_custom_command(OUTPUT out TARGET target)
|
|
@ -0,0 +1,8 @@
|
|||
include(RunCMake)
|
||||
|
||||
run_cmake(AppendNoOutput)
|
||||
run_cmake(AppendNotOutput)
|
||||
run_cmake(BadArgument)
|
||||
run_cmake(NoArguments)
|
||||
run_cmake(NoOutputOrTarget)
|
||||
run_cmake(OutputAndTarget)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1,3 @@
|
|||
add_custom_target("#")
|
||||
add_custom_target("<")
|
||||
add_custom_target(">")
|
|
@ -0,0 +1,3 @@
|
|||
cmake_minimum_required(VERSION 3.1)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1 @@
|
|||
add_custom_target()
|
|
@ -0,0 +1,4 @@
|
|||
include(RunCMake)
|
||||
|
||||
run_cmake(NoArguments)
|
||||
run_cmake(BadTargetName)
|
Loading…
Reference in New Issue