summaryrefslogtreecommitdiffstats
path: root/Tests/CTestUpdateGIT.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-11 13:00:01 (GMT)
committerBrad King <brad.king@kitware.com>2015-06-11 15:00:48 (GMT)
commit493388ce48cb4188068c6f0379bb2afa60c0a41a (patch)
tree6889955607c65377409721fc2d983cdb565194ab /Tests/CTestUpdateGIT.cmake.in
parentbcf258032fe79c75965722f25ec5f76ff472a19c (diff)
downloadCMake-493388ce48cb4188068c6f0379bb2afa60c0a41a.zip
CMake-493388ce48cb4188068c6f0379bb2afa60c0a41a.tar.gz
CMake-493388ce48cb4188068c6f0379bb2afa60c0a41a.tar.bz2
ctest_update: Fix RETURN_VALUE on VCS tool failure (#15610)
Make RETURN_VALUE report -1 if the update command failed as the documentation claims. Also avoid reporting a ctest script-level failure if the update command fails because we still correctly administered the update step.
Diffstat (limited to 'Tests/CTestUpdateGIT.cmake.in')
-rw-r--r--Tests/CTestUpdateGIT.cmake.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 3734e2b..6488a1f 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -358,3 +358,23 @@ run_dashboard_script(dash-binary-quiet)
if("${OUTPUT}" MATCHES "Updating the repository")
message(FATAL_ERROR "Found 'Updating the repository' in quiet output")
endif()
+
+#-----------------------------------------------------------------------------
+# Test ctest_update(RETURN_VALUE) on failure
+message("Running CTest Dashboard Script (fail to update)...")
+
+set(ctest_update_check [[
+
+if(NOT ret LESS 0)
+ message(FATAL_ERROR "ctest_update incorrectly succeeded with ${ret}")
+endif()
+]])
+create_dashboard_script(dash-binary-fail
+ "set(CTEST_GIT_COMMAND \"update-command-does-not-exist\")
+")
+unset(ctest_update_check)
+
+# Run the dashboard script with CTest.
+set(FAIL_UPDATE 1)
+run_dashboard_script(dash-binary-fail)
+unset(FAIL_UPDATE)