summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ctest_update
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2019-04-23 18:28:28 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2019-04-23 18:56:46 (GMT)
commit95db11fdb189a08a8530a767dea2c272e3605077 (patch)
treee304eb8291a542d65b179f6145144cf03508a96a /Tests/RunCMake/ctest_update
parentd170a3177fdc57c96034f8a2ecf5d0f9aff70af4 (diff)
downloadCMake-95db11fdb189a08a8530a767dea2c272e3605077.zip
CMake-95db11fdb189a08a8530a767dea2c272e3605077.tar.gz
CMake-95db11fdb189a08a8530a767dea2c272e3605077.tar.bz2
ctest: Include ChangeId in Update.xml
Diffstat (limited to 'Tests/RunCMake/ctest_update')
-rw-r--r--Tests/RunCMake/ctest_update/CMakeLists.txt.in4
-rw-r--r--Tests/RunCMake/ctest_update/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake12
-rw-r--r--Tests/RunCMake/ctest_update/test.cmake.in16
4 files changed, 49 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_update/CMakeLists.txt.in b/Tests/RunCMake/ctest_update/CMakeLists.txt.in
new file mode 100644
index 0000000..ecf0e54
--- /dev/null
+++ b/Tests/RunCMake/ctest_update/CMakeLists.txt.in
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.1)
+project(CTestTest@CASE_NAME@ NONE)
+include(CTest)
+@CASE_CMAKELISTS_SUFFIX_CODE@
diff --git a/Tests/RunCMake/ctest_update/RunCMakeTest.cmake b/Tests/RunCMake/ctest_update/RunCMakeTest.cmake
new file mode 100644
index 0000000..0e1748f
--- /dev/null
+++ b/Tests/RunCMake/ctest_update/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCTest)
+set(CASE_CTEST_UPDATE_ARGS "")
+function(run_ctest_update CASE_NAME)
+ set(CASE_CTEST_UPDATE_ARGS "${ARGN}")
+ run_ctest(${CASE_NAME})
+endfunction()
+
+run_ctest_update(TestQuiet QUIET)
+
+function(run_TestChangeId)
+ set(CASE_TEST_PREFIX_CODE [[
+ set(CTEST_CHANGE_ID "<>1")
+ ]])
+
+ run_ctest(TestChangeId)
+endfunction()
+run_TestChangeId()
diff --git a/Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake b/Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake
new file mode 100644
index 0000000..9269fbc
--- /dev/null
+++ b/Tests/RunCMake/ctest_update/UpdateChangeId-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 [[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}"
+ )
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Update.xml not found")
+endif()
diff --git a/Tests/RunCMake/ctest_update/test.cmake.in b/Tests/RunCMake/ctest_update/test.cmake.in
new file mode 100644
index 0000000..abbef74
--- /dev/null
+++ b/Tests/RunCMake/ctest_update/test.cmake.in
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.1)
+@CASE_TEST_PREFIX_CODE@
+
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_UPDATE_COMMAND "@GIT_EXECUTABLE@")
+
+set(ctest_test_args "@CASE_CTEST_UPDATE_ARGS@")
+ctest_start(Experimental)
+ctest_update(${ctest_update_args})