Commit 39baf728 authored by Brad King's avatar Brad King

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.
parent 0b3b54e2
......@@ -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)
......
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\)
add_custom_command(TARGET x APPEND DEPENDS a b c d)
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\)
add_custom_command(OUTPUT out APPEND DEPENDS dep)
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\)
add_custom_command(bad_arg OUTPUT a b c d)
cmake_minimum_required(VERSION 3.1)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
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\)
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\)
add_custom_command(COMMAND echo a b c d)
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\)
add_custom_command(OUTPUT out TARGET target)
include(RunCMake)
run_cmake(AppendNoOutput)
run_cmake(AppendNotOutput)
run_cmake(BadArgument)
run_cmake(NoArguments)
run_cmake(NoOutputOrTarget)
run_cmake(OutputAndTarget)
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\)
add_custom_target("#")
add_custom_target("<")
add_custom_target(">")
cmake_minimum_required(VERSION 3.1)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
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\)
include(RunCMake)
run_cmake(NoArguments)
run_cmake(BadTargetName)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment