diff options
author | Brad King <brad.king@kitware.com> | 2019-09-26 13:47:41 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-26 13:47:51 (GMT) |
commit | df982c4e189c01896db487ec5edfe85d27911007 (patch) | |
tree | fa4cc82d4a051321e7b3b14c130c8d6d45f9f63d /Tests | |
parent | 5fa625d611414ac567fd7a6bb5b3b416ea93eca2 (diff) | |
parent | fd3a39461457540157ea9bee2f9ea7620dfd1c7f (diff) | |
download | CMake-df982c4e189c01896db487ec5edfe85d27911007.zip CMake-df982c4e189c01896db487ec5edfe85d27911007.tar.gz CMake-df982c4e189c01896db487ec5edfe85d27911007.tar.bz2 |
Merge topic 'add-custom-target-byproduct-checks'
fd3a394614 add_custom_command: Format files in error message in a single line
a1cc6b4447 add_custom_target: Add output checks for custom target byproducts
cbb861ade8 add_custom_command: Add tests for custom command output checks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3850
Diffstat (limited to 'Tests')
12 files changed, 136 insertions, 4 deletions
diff --git a/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt index cd542d8..b7ee23a 100644 --- a/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt +++ b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt @@ -1,7 +1,7 @@ CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\): add_custom_command given APPEND option with output - .*RunCMake/add_custom_command/AppendNotOutput-build/out.* + .*RunCMake/add_custom_command/AppendNotOutput-build/out which is not already a custom command output. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-result.txt b/Tests/RunCMake/add_custom_command/BadByproduct-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadByproduct-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt new file mode 100644 index 0000000..086e397 --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt @@ -0,0 +1,36 @@ +CMake Error at BadByproduct.cmake:2 \(add_custom_command\): + add_custom_command called with BYPRODUCTS containing a "#". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:3 \(add_custom_command\): + add_custom_command called with BYPRODUCTS containing a "<". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:4 \(add_custom_command\): + add_custom_command called with BYPRODUCTS containing a ">". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:5 \(add_custom_command\): + add_custom_command called with BYPRODUCTS containing a "<". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:6 \(add_custom_command\): + add_custom_command attempted to have a file + + .*RunCMake/add_custom_command/f + + in a source directory as an output of custom command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/add_custom_command/BadByproduct.cmake b/Tests/RunCMake/add_custom_command/BadByproduct.cmake new file mode 100644 index 0000000..91bca52 --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadByproduct.cmake @@ -0,0 +1,6 @@ +set(CMAKE_DISABLE_SOURCE_CHANGES ON) +add_custom_command(OUTPUT a BYPRODUCTS "a#") +add_custom_command(OUTPUT b BYPRODUCTS "a<") +add_custom_command(OUTPUT c BYPRODUCTS "a>") +add_custom_command(OUTPUT d BYPRODUCTS "$<CONFIG>/#") +add_custom_command(OUTPUT e BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/f) diff --git a/Tests/RunCMake/add_custom_command/BadOutput-result.txt b/Tests/RunCMake/add_custom_command/BadOutput-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadOutput-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt new file mode 100644 index 0000000..731e58d --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt @@ -0,0 +1,36 @@ +CMake Error at BadOutput.cmake:2 \(add_custom_command\): + add_custom_command called with OUTPUT containing a "#". This character is + not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadOutput.cmake:3 \(add_custom_command\): + add_custom_command called with OUTPUT containing a "<". This character is + not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadOutput.cmake:4 \(add_custom_command\): + add_custom_command called with OUTPUT containing a ">". This character is + not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadOutput.cmake:5 \(add_custom_command\): + add_custom_command called with OUTPUT containing a "<". This character is + not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadOutput.cmake:6 \(add_custom_command\): + add_custom_command attempted to have a file + + .*RunCMake/add_custom_command/e + + in a source directory as an output of custom command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/add_custom_command/BadOutput.cmake b/Tests/RunCMake/add_custom_command/BadOutput.cmake new file mode 100644 index 0000000..6875fe9 --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadOutput.cmake @@ -0,0 +1,6 @@ +set(CMAKE_DISABLE_SOURCE_CHANGES ON) +add_custom_command(OUTPUT "a#" COMMAND a) +add_custom_command(OUTPUT "a<" COMMAND b) +add_custom_command(OUTPUT "a>" COMMAND c) +add_custom_command(OUTPUT "$<CONFIG>/#" COMMAND d) +add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/e COMMAND f) diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake index 270df2f..96642fa 100644 --- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake @@ -4,6 +4,8 @@ run_cmake(AppendLiteralQuotes) run_cmake(AppendNoOutput) run_cmake(AppendNotOutput) run_cmake(BadArgument) +run_cmake(BadByproduct) +run_cmake(BadOutput) run_cmake(GeneratedProperty) run_cmake(LiteralQuotes) run_cmake(NoArguments) diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-result.txt b/Tests/RunCMake/add_custom_target/BadByproduct-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/add_custom_target/BadByproduct-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt new file mode 100644 index 0000000..0f58550 --- /dev/null +++ b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt @@ -0,0 +1,36 @@ +CMake Error at BadByproduct.cmake:2 \(add_custom_target\): + add_custom_target called with BYPRODUCTS containing a "#". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:3 \(add_custom_target\): + add_custom_target called with BYPRODUCTS containing a "<". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:4 \(add_custom_target\): + add_custom_target called with BYPRODUCTS containing a ">". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:5 \(add_custom_target\): + add_custom_target called with BYPRODUCTS containing a "<". This character + is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at BadByproduct.cmake:6 \(add_custom_target\): + add_custom_target attempted to have a file + + .*RunCMake/add_custom_target/j + + in a source directory as an output of custom command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/add_custom_target/BadByproduct.cmake b/Tests/RunCMake/add_custom_target/BadByproduct.cmake new file mode 100644 index 0000000..963d641 --- /dev/null +++ b/Tests/RunCMake/add_custom_target/BadByproduct.cmake @@ -0,0 +1,6 @@ +set(CMAKE_DISABLE_SOURCE_CHANGES ON) +add_custom_target(a BYPRODUCTS "a#" COMMAND b) +add_custom_target(c BYPRODUCTS "a<" COMMAND d) +add_custom_target(e BYPRODUCTS "a>" COMMAND f) +add_custom_target(g BYPRODUCTS "$<CONFIG>/#" COMMAND h) +add_custom_target(i BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/j COMMAND k) diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake index 49c7d3e..f5d5dd2 100644 --- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake @@ -1,11 +1,12 @@ include(RunCMake) -run_cmake(CommandExpandsEmpty) -run_cmake(GeneratedProperty) -run_cmake(NoArguments) +run_cmake(BadByproduct) run_cmake(BadTargetName) run_cmake(ByproductsNoCommand) +run_cmake(CommandExpandsEmpty) +run_cmake(GeneratedProperty) run_cmake(LiteralQuotes) +run_cmake(NoArguments) run_cmake(UsesTerminalNoCommand) function(run_TargetOrder) |