diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CTestUpdateCommon.cmake | 48 | ||||
-rw-r--r-- | Tests/CTestUpdateGIT.cmake.in | 17 |
2 files changed, 58 insertions, 7 deletions
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake index 857c6f5..97153f0 100644 --- a/Tests/CTestUpdateCommon.cmake +++ b/Tests/CTestUpdateCommon.cmake @@ -219,6 +219,36 @@ function(run_dashboard_command_line bin_dir) endfunction() #----------------------------------------------------------------------------- +# Function to find the Update.xml file and make sure +# it only has the Revision in it and no updates +function(check_no_update bin_dir) + set(PATTERN ${TOP}/${bin_dir}/Testing/*/Update.xml) + file(GLOB UPDATE_XML_FILE RELATIVE ${TOP} ${PATTERN}) + string(REGEX REPLACE "//Update.xml$" "/Update.xml" + UPDATE_XML_FILE "${UPDATE_XML_FILE}") + message(" found ${UPDATE_XML_FILE}") + set(rev_regex "Revision|PriorRevision") + file(STRINGS ${TOP}/${UPDATE_XML_FILE} UPDATE_XML_REVISIONS + REGEX "^\t<(${rev_regex})>[^<\n]+</(${rev_regex})>$" + ) + set(found_revisons FALSE) + foreach(r IN LISTS UPDATE_XML_REVISIONS) + if("${r}" MATCHES "PriorRevision") + message(FATAL_ERROR "Found PriorRevision in no update test") + endif() + if("${r}" MATCHES "<Revision>") + set(found_revisons TRUE) + endif() + endforeach() + if(found_revisons) + message(" found <Revision> in no update test") + else() + message(FATAL_ERROR " missing <Revision> in no update test") + endif() +endfunction() + + +#----------------------------------------------------------------------------- # Function to run the dashboard through a script function(run_dashboard_script bin_dir) run_child( @@ -228,13 +258,17 @@ function(run_dashboard_script bin_dir) # Verify the updates reported by CTest. list(APPEND UPDATE_MAYBE Updated{subdir} Updated{CTestConfig.cmake}) - check_updates(${bin_dir} - Updated{foo.txt} - Updated{bar.txt} - Updated{zot.txt} - Updated{subdir/foo.txt} - Updated{subdir/bar.txt} - ) + if(NO_UPDATE) + check_no_update(${bin_dir}) + else() + check_updates(${bin_dir} + Updated{foo.txt} + Updated{bar.txt} + Updated{zot.txt} + Updated{subdir/foo.txt} + Updated{subdir/bar.txt} + ) + endif() endfunction() #----------------------------------------------------------------------------- diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index f6939de..41b732b 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -317,3 +317,20 @@ set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master) # Run the dashboard script with CTest. run_dashboard_script(dash-binary-custom) + + +rewind_source(dash-source) + +#----------------------------------------------------------------------------- +# Test no update with a dashboard script. +message("Running CTest Dashboard Script (No update)...") + +create_dashboard_script(dash-binary-no-update + "# git command configuration +set(CTEST_GIT_COMMAND \"${GIT}\") +set(CTEST_UPDATE_VERSION_ONLY TRUE) +") + +# Run the dashboard script with CTest. +set(NO_UPDATE 1) +run_dashboard_script(dash-binary-no-update) |