Commit a7eb2877 authored by Kyle Edwards's avatar Kyle Edwards Committed by Kitware Robot

Merge topic 'ctest_xml_tweaks'

d8af0700 ctest: consistently format generator name
95db11fd ctest: Include ChangeId in Update.xml
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3259
parents 993dfa89 d8af0700
Pipeline #135475 passed with stage
in 0 seconds
......@@ -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);
......
......@@ -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");
......
......@@ -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");
......
......@@ -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)
......
cmake_minimum_required(VERSION 3.1)
project(CTestTest@CASE_NAME@ NONE)
include(CTest)
@CASE_CMAKELISTS_SUFFIX_CODE@
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()
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()
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})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment