diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2016-07-28 19:12:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-20 17:14:20 (GMT) |
commit | d328dc6853e211dc05c4abcf62cc64b9c91235a2 (patch) | |
tree | 188238fc8ae3c7a85dc3edf1eae3a70b85b6197f /Tests/RunCMake/ctest_cmake_error/RunCMakeTest.cmake | |
parent | 9ac2e189607433b45b252a1e2261ccfaf11e492b (diff) | |
download | CMake-d328dc6853e211dc05c4abcf62cc64b9c91235a2.zip CMake-d328dc6853e211dc05c4abcf62cc64b9c91235a2.tar.gz CMake-d328dc6853e211dc05c4abcf62cc64b9c91235a2.tar.bz2 |
CTest: Add CAPTURE_CMAKE_ERROR val to `ctest_*` commands
If a `ctest_*` command has CAPTURE_CMAKE_ERROR then any errors generated
by cmake during that command will cause the value to be assigned `-1`.
This will prevent a `ctest -S` script from returning non-zero unless the
script explicitly calls `message(FATAL_ERROR)`.
Diffstat (limited to 'Tests/RunCMake/ctest_cmake_error/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/ctest_cmake_error/RunCMakeTest.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_cmake_error/RunCMakeTest.cmake b/Tests/RunCMake/ctest_cmake_error/RunCMakeTest.cmake new file mode 100644 index 0000000..0ec04c2 --- /dev/null +++ b/Tests/RunCMake/ctest_cmake_error/RunCMakeTest.cmake @@ -0,0 +1,10 @@ +include(RunCTest) + +set(CASE_CTEST_COVERAGE_ARGS "") + +function(run_ctest_coverage CASE_NAME) + set(CASE_CTEST_COVERAGE_ARGS "${ARGN}") + run_ctest(${CASE_NAME}) +endfunction() + +run_ctest_coverage(CTestCaptureErrorNonZero junk CAPTURE_CMAKE_ERROR val) |