summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-08 19:41:08 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-12 13:06:49 (GMT)
commit226df303f955a8756cda7544f58242b52ea7ec2e (patch)
treef4ad45a19cb1b2387b93f76355f06d19c8b9dbfd /Tests/RunCMake/ctest_build/RunCMakeTest.cmake
parent28e7a135e001afb36a7cff8e896ebac75390dde0 (diff)
downloadCMake-226df303f955a8756cda7544f58242b52ea7ec2e.zip
CMake-226df303f955a8756cda7544f58242b52ea7ec2e.tar.gz
CMake-226df303f955a8756cda7544f58242b52ea7ec2e.tar.bz2
CTest: Stop telling 'make' to ignore errors with -i
Add policy CMP0061 to maintain compatibility for existing projects.
Diffstat (limited to 'Tests/RunCMake/ctest_build/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/ctest_build/RunCMakeTest.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 5826fe4..c6f732c 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -8,3 +8,26 @@ function(run_ctest_build CASE_NAME)
endfunction()
run_ctest_build(BuildQuiet QUIET)
+
+function(run_BuildFailure)
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_custom_target(BuildFailure ALL COMMAND command-does-not-exist)
+]])
+ set(CASE_TEST_PREFIX_CODE [[
+cmake_policy(SET CMP0061 NEW)
+]])
+ set(CASE_TEST_SUFFIX_CODE [[
+if (ctest_build_return_value)
+ message("ctest_build returned non-zero")
+else()
+ message("ctest_build returned zero")
+endif()
+]])
+ run_ctest(BuildFailure)
+
+ if (RunCMake_GENERATOR MATCHES "Makefiles")
+ set(CASE_TEST_PREFIX_CODE "")
+ run_ctest(BuildFailure-CMP0061-OLD)
+ endif()
+endfunction()
+run_BuildFailure()