summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-05-08 12:49:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-08 12:49:34 (GMT)
commit4aace9b015cd95209c191139b091acbe0c047864 (patch)
tree3683b98e66ffc2332206a6e2701ea52677758613 /Tests
parentafd7df9d1cd9f4aefc3a15e274cd8c6fb01e339c (diff)
parent2a34d0ac3613101996b4e751bc2653e4cbeaf5b0 (diff)
downloadCMake-4aace9b015cd95209c191139b091acbe0c047864.zip
CMake-4aace9b015cd95209c191139b091acbe0c047864.tar.gz
CMake-4aace9b015cd95209c191139b091acbe0c047864.tar.bz2
Merge topic 'ctest-update-version-override'
2a34d0ac36 ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE 7ddac95121 Help: cross-ref and wording of docs related to ctest_update() a0d04d8810 testing: Update terminology in ctest_update tests Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Zack Galbreath <zack.galbreath@kitware.com> Merge-request: !3277
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/ctest_update/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/ctest_update/UpdateActualVersion-check.cmake12
-rw-r--r--Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake2
3 files changed, 25 insertions, 5 deletions
diff --git a/Tests/RunCMake/ctest_update/RunCMakeTest.cmake b/Tests/RunCMake/ctest_update/RunCMakeTest.cmake
index 0e1748f..f8d7665 100644
--- a/Tests/RunCMake/ctest_update/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_update/RunCMakeTest.cmake
@@ -5,13 +5,21 @@ function(run_ctest_update CASE_NAME)
run_ctest(${CASE_NAME})
endfunction()
-run_ctest_update(TestQuiet QUIET)
+run_ctest_update(UpdateQuiet QUIET)
-function(run_TestChangeId)
+function(run_UpdateChangeId)
set(CASE_TEST_PREFIX_CODE [[
set(CTEST_CHANGE_ID "<>1")
]])
- run_ctest(TestChangeId)
+ run_ctest(UpdateChangeId)
endfunction()
-run_TestChangeId()
+run_UpdateChangeId()
+
+function(run_UpdateVersionOverride)
+ set(CASE_TEST_PREFIX_CODE [[
+ set(CTEST_UPDATE_VERSION_OVERRIDE "qwertyuiop")
+ ]])
+ run_ctest(UpdateVersionOverride)
+endfunction()
+run_UpdateVersionOverride()
diff --git a/Tests/RunCMake/ctest_update/UpdateActualVersion-check.cmake b/Tests/RunCMake/ctest_update/UpdateActualVersion-check.cmake
new file mode 100644
index 0000000..12bd5a0
--- /dev/null
+++ b/Tests/RunCMake/ctest_update/UpdateActualVersion-check.cmake
@@ -0,0 +1,12 @@
+file(GLOB update_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Update.xml")
+if(update_xml_file)
+ file(READ "${update_xml_file}" update_xml LIMIT 4096)
+ if(NOT update_xml MATCHES "qwertyuiop")
+ string(REPLACE "\n" "\n " update_xml " ${update_xml}")
+ set(RunCMake_TEST_FAILED
+ "Did not find 'qwertyuiop' in Update.xml:\n${update_xml}"
+ )
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Update.xml not found")
+endif()
diff --git a/Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake b/Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake
index 9269fbc..382fbec 100644
--- a/Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake
+++ b/Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake
@@ -1,7 +1,7 @@
file(GLOB update_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Update.xml")
if(update_xml_file)
file(READ "${update_xml_file}" update_xml LIMIT 4096)
- if(NOT update_xml MATCHES [[ChangeId="&lt;&gt;1"]])
+ if(NOT update_xml MATCHES [[ChangeId>&lt;&gt;1]])
string(REPLACE "\n" "\n " update_xml " ${update_xml}")
set(RunCMake_TEST_FAILED
"Update.xml does not have expected ChangeId:\n${update_xml}"