diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2014-08-13 17:45:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-08-18 15:21:36 (GMT) |
commit | 39b5df2f3714c32d498fcb7c88f5bda456f75cb3 (patch) | |
tree | 837969d25d89a20025ced7cbecbe73236cd7a650 /Tests/CTestUpdateCommon.cmake | |
parent | ffc1935a73267cfe74e5d5492c9621ccf6c66112 (diff) | |
download | CMake-39b5df2f3714c32d498fcb7c88f5bda456f75cb3.zip CMake-39b5df2f3714c32d498fcb7c88f5bda456f75cb3.tar.gz CMake-39b5df2f3714c32d498fcb7c88f5bda456f75cb3.tar.bz2 |
ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version
This allows ctest_update to get the current version without actually
changing the repository. This is useful when using Jenkins or an
external project to update the source to a specific version, but you
still want the current version to show up in CDash.
Diffstat (limited to 'Tests/CTestUpdateCommon.cmake')
-rw-r--r-- | Tests/CTestUpdateCommon.cmake | 48 |
1 files changed, 41 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() #----------------------------------------------------------------------------- |