diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2019-04-30 20:12:02 (GMT) |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2019-05-07 14:45:47 (GMT) |
commit | 2a34d0ac3613101996b4e751bc2653e4cbeaf5b0 (patch) | |
tree | 7b1e9f211a1f5fd33f7950058968c08cc6544f68 /Tests | |
parent | 7ddac9512188d1dbfcac76b24957956a197370ad (diff) | |
download | CMake-2a34d0ac3613101996b4e751bc2653e4cbeaf5b0.zip CMake-2a34d0ac3613101996b4e751bc2653e4cbeaf5b0.tar.gz CMake-2a34d0ac3613101996b4e751bc2653e4cbeaf5b0.tar.bz2 |
ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE
Set this in a CTest script to explicitly define what the current revision
will be reported as in Update.xml.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/ctest_update/RunCMakeTest.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_update/UpdateActualVersion-check.cmake | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_update/RunCMakeTest.cmake b/Tests/RunCMake/ctest_update/RunCMakeTest.cmake index f7a31e5..f8d7665 100644 --- a/Tests/RunCMake/ctest_update/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_update/RunCMakeTest.cmake @@ -15,3 +15,11 @@ function(run_UpdateChangeId) run_ctest(UpdateChangeId) endfunction() 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() |