summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CTestUpdateCommon.cmake6
-rw-r--r--Tests/CTestUpdateGIT.cmake.in33
2 files changed, 39 insertions, 0 deletions
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 97153f0..77b3398 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -13,6 +13,9 @@ function(run_child)
message(FATAL_ERROR "Child failed (${FAILED}), output is\n ${OUTPUT}\n"
"Command = [${ARGN}]\n")
endif()
+
+ # Pass output back up to the parent scope for possible further inspection.
+ set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
endfunction()
#-----------------------------------------------------------------------------
@@ -269,6 +272,9 @@ function(run_dashboard_script bin_dir)
Updated{subdir/bar.txt}
)
endif()
+
+ # Pass console output up to the parent, in case they'd like to inspect it.
+ set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
endfunction()
#-----------------------------------------------------------------------------
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 41b732b..5987a30 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -334,3 +334,36 @@ set(CTEST_UPDATE_VERSION_ONLY TRUE)
# Run the dashboard script with CTest.
set(NO_UPDATE 1)
run_dashboard_script(dash-binary-no-update)
+
+rewind_source(dash-source)
+
+#-----------------------------------------------------------------------------
+# Test ctest_update(QUIET)
+set(NO_UPDATE 0)
+message("Running CTest Dashboard Script (update quietly)...")
+
+create_dashboard_script(dash-binary-quiet
+ "# git command configuration
+set(CTEST_GIT_COMMAND \"${GIT}\")
+set(CTEST_GIT_UPDATE_OPTIONS)
+set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
+")
+
+# We need to modify the created dashboard script to include our "QUIET"
+# option.
+set(filename "${TOP}/dash-binary-quiet.cmake")
+file(READ "${filename}" contents)
+string(REPLACE
+ [=[ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY})]=]
+ [=[ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY} QUIET)]=]
+ contents
+ "${contents}")
+file(WRITE "${filename}" "${contents}")
+
+# Run the dashboard script with CTest.
+run_dashboard_script(dash-binary-quiet)
+
+# Make sure the output seems quiet.
+if("${OUTPUT}" MATCHES "Updating the repository")
+ message(FATAL_ERROR "Found 'Updating the repository' in quiet output")
+endif()