mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-26 08:29:54 -06:00
Merge topic 'ctest-upload-xml-time'
b47ccc6ba0 ctest: include "Time" element in Upload.xml
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9292
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmCTestUploadHandler.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
@@ -54,6 +55,7 @@ int cmCTestUploadHandler::ProcessHandler()
|
||||
std::string("ctest-") + cmVersion::GetCMakeVersion());
|
||||
this->CTest->AddSiteProperties(xml);
|
||||
xml.StartElement("Upload");
|
||||
xml.Element("Time", std::chrono::system_clock::now());
|
||||
|
||||
for (std::string const& file : this->Files) {
|
||||
cmCTestOptionalLog(this->CTest, OUTPUT,
|
||||
|
||||
12
Tests/RunCMake/ctest_upload/UploadQuiet-check.cmake
Normal file
12
Tests/RunCMake/ctest_upload/UploadQuiet-check.cmake
Normal file
@@ -0,0 +1,12 @@
|
||||
file(GLOB upload_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Upload.xml")
|
||||
if(upload_xml_file)
|
||||
file(READ "${upload_xml_file}" upload_xml LIMIT 4096)
|
||||
if(NOT upload_xml MATCHES "<Time>")
|
||||
string(REPLACE "\n" "\n " upload_xml " ${upload_xml}")
|
||||
set(RunCMake_TEST_FAILED
|
||||
"Upload.xml does not contain a <Time> attribute:\n${upload_xml}"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
set(RunCMake_TEST_FAILED "Upload.xml not found")
|
||||
endif()
|
||||
Reference in New Issue
Block a user