summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-08-18 15:21:55 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-08-18 15:21:55 (GMT)
commite7dda7b9b7373dc823977766d0947a4ca28845cd (patch)
treef63fc18d0ff729134934c0e8ee800496a497c45a /Tests
parentde547ca5c3053293d144b3c8b133f701d4b81150 (diff)
parent653529ce55a9c33fa7378708793caac92a857794 (diff)
downloadCMake-e7dda7b9b7373dc823977766d0947a4ca28845cd.zip
CMake-e7dda7b9b7373dc823977766d0947a4ca28845cd.tar.gz
CMake-e7dda7b9b7373dc823977766d0947a4ca28845cd.tar.bz2
Merge topic 'ctest_update_status_only'
653529ce CTest: Allow / to be in the build name, and be consistent with the build name 39b5df2f ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CTestUpdateCommon.cmake48
-rw-r--r--Tests/CTestUpdateGIT.cmake.in17
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)