diff options
Diffstat (limited to 'Tests/RunCMake/ctest_build/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/ctest_build/RunCMakeTest.cmake | 23 |
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() |