summaryrefslogtreecommitdiff
path: root/Tests/CTestUpdateCommon.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CTestUpdateCommon.cmake')
-rw-r--r--Tests/CTestUpdateCommon.cmake48
1 files changed, 41 insertions, 7 deletions
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 857c6f5680..97153f0f94 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()
#-----------------------------------------------------------------------------