Tests: Simplify CTest.UpdateGIT QUIET mode test
Parameterize the dashboard script generation to configure custom content. Also move state cleanup from previous test back to its block.
This commit is contained in:
parent
f9285727dc
commit
b6667729cb
|
@ -193,7 +193,7 @@ set(CTEST_BINARY_DIRECTORY \${CTEST_DASHBOARD_ROOT}/${bin_dir})
|
||||||
${custom_text}
|
${custom_text}
|
||||||
# Start a dashboard and run the update step
|
# Start a dashboard and run the update step
|
||||||
ctest_start(Experimental)
|
ctest_start(Experimental)
|
||||||
ctest_update(SOURCE \${CTEST_SOURCE_DIRECTORY})
|
ctest_update(SOURCE \${CTEST_SOURCE_DIRECTORY} ${ctest_update_args})
|
||||||
")
|
")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
|
@ -334,31 +334,22 @@ set(CTEST_UPDATE_VERSION_ONLY TRUE)
|
||||||
# Run the dashboard script with CTest.
|
# Run the dashboard script with CTest.
|
||||||
set(NO_UPDATE 1)
|
set(NO_UPDATE 1)
|
||||||
run_dashboard_script(dash-binary-no-update)
|
run_dashboard_script(dash-binary-no-update)
|
||||||
|
unset(NO_UPDATE)
|
||||||
|
|
||||||
rewind_source(dash-source)
|
rewind_source(dash-source)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Test ctest_update(QUIET)
|
# Test ctest_update(QUIET)
|
||||||
set(NO_UPDATE 0)
|
|
||||||
message("Running CTest Dashboard Script (update quietly)...")
|
message("Running CTest Dashboard Script (update quietly)...")
|
||||||
|
|
||||||
|
set(ctest_update_args QUIET)
|
||||||
create_dashboard_script(dash-binary-quiet
|
create_dashboard_script(dash-binary-quiet
|
||||||
"# git command configuration
|
"# git command configuration
|
||||||
set(CTEST_GIT_COMMAND \"${GIT}\")
|
set(CTEST_GIT_COMMAND \"${GIT}\")
|
||||||
set(CTEST_GIT_UPDATE_OPTIONS)
|
set(CTEST_GIT_UPDATE_OPTIONS)
|
||||||
set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
|
set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
|
||||||
")
|
")
|
||||||
|
unset(ctest_update_args)
|
||||||
# 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 the dashboard script with CTest.
|
||||||
run_dashboard_script(dash-binary-quiet)
|
run_dashboard_script(dash-binary-quiet)
|
||||||
|
|
Loading…
Reference in New Issue