summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-04-24 13:30:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-04-24 13:30:42 (GMT)
commita7eb2877b87117fb02ae4d3b730361defca4a96d (patch)
tree82cd9a0dd574b178eaeb57fdb6e77f9cdcecb93d
parent993dfa89d8f49e06d44e86c97502a5d7630f3dcf (diff)
parentd8af0700a3cf1391f33c5585c4d19e331d968d4a (diff)
downloadCMake-a7eb2877b87117fb02ae4d3b730361defca4a96d.zip
CMake-a7eb2877b87117fb02ae4d3b730361defca4a96d.tar.gz
CMake-a7eb2877b87117fb02ae4d3b730361defca4a96d.tar.bz2
Merge topic 'ctest_xml_tweaks'
d8af0700a3 ctest: consistently format generator name 95db11fdb1 ctest: Include ChangeId in Update.xml Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3259
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx4
-rw-r--r--Source/CTest/cmCTestUploadHandler.cxx2
-rw-r--r--Source/cmCTest.cxx2
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-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
8 files changed, 56 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index e3b7e9e..5cfc4a7 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -199,6 +199,10 @@ int cmCTestUpdateHandler::ProcessHandler()
xml.Element("UpdateCommand", vc->GetUpdateCommandLine());
xml.Element("UpdateType",
cmCTestUpdateHandlerUpdateToString(this->UpdateType));
+ std::string changeId = this->CTest->GetCTestConfiguration("ChangeId");
+ if (!changeId.empty()) {
+ xml.Element("ChangeId", changeId);
+ }
bool loadedMods = vc->WriteXML(xml);
diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx
index ee9ee91..9efdf70 100644
--- a/Source/CTest/cmCTestUploadHandler.cxx
+++ b/Source/CTest/cmCTestUploadHandler.cxx
@@ -51,7 +51,7 @@ int cmCTestUploadHandler::ProcessHandler()
this->CTest->GetTestModelString());
xml.Attribute("Name", this->CTest->GetCTestConfiguration("Site"));
xml.Attribute("Generator",
- std::string("ctest") + cmVersion::GetCMakeVersion());
+ std::string("ctest-") + cmVersion::GetCMakeVersion());
this->CTest->AddSiteProperties(xml);
xml.StartElement("Upload");
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 709feac..003ebdc 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1523,7 +1523,7 @@ int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml,
this->Impl->CurrentTag + "-" + this->GetTestModelString());
xml.Attribute("Name", this->GetCTestConfiguration("Site"));
xml.Attribute("Generator",
- std::string("ctest") + cmVersion::GetCMakeVersion());
+ std::string("ctest-") + cmVersion::GetCMakeVersion());
this->AddSiteProperties(xml);
xml.StartElement("Notes");
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 4973e55..2b78171 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -259,6 +259,7 @@ add_RunCMake_test(ctest_submit)
add_RunCMake_test(ctest_test)
add_RunCMake_test(ctest_disabled_test)
add_RunCMake_test(ctest_skipped_test)
+add_RunCMake_test(ctest_update -DGIT_EXECUTABLE=${GIT_EXECUTABLE})
add_RunCMake_test(ctest_upload)
add_RunCMake_test(ctest_fixtures)
add_RunCMake_test(file)
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})