diff options
author | Brad King <brad.king@kitware.com> | 2023-07-28 13:12:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-07-28 13:12:23 (GMT) |
commit | e49ff2b2f27a783226ebabb936a66f8e5a38705c (patch) | |
tree | 56153ca869dfab0dd780c2484517609f6eade662 | |
parent | 3b62d295510ca44c9943a6e2cf23b174f92168f5 (diff) | |
parent | 2b99e64413ba6750deda892d7398906ade7b3737 (diff) | |
download | CMake-e49ff2b2f27a783226ebabb936a66f8e5a38705c.zip CMake-e49ff2b2f27a783226ebabb936a66f8e5a38705c.tar.gz CMake-e49ff2b2f27a783226ebabb936a66f8e5a38705c.tar.bz2 |
Merge topic 'ExportTestLabelToJUnit'
2b99e64413 set_test_properties: link to the test properties in the documentation
b11e8afbfa ctest: export test labels to junit xml
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8635
-rw-r--r-- | Help/command/set_tests_properties.rst | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index 125e460..1df9d73 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -20,4 +20,4 @@ See Also * :command:`add_test` * :command:`define_property` * the more general :command:`set_property` command -* :ref:`Target Properties` for the list of properties known to CMake +* :ref:`Test Properties` for the list of properties known to CMake diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 6b02a5e..5ac696b 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2617,6 +2617,21 @@ bool cmCTestTestHandler::WriteJUnitXML() xml.EndElement(); // </failure> } + xml.StartElement("properties"); + if ((result.Properties) && (!result.Properties->Labels.empty())) { + xml.StartElement("property"); + xml.Attribute("name", "cmake_labels"); + // Pass the property as a cmake-formatted list, consumers will know + // anyway that this information is coming from cmake, so it should + // be ok to put it here as a cmake-list. + xml.Attribute("value", cmList::to_string(result.Properties->Labels)); + // if we export more properties, this should be done the same way, + // i.e. prefix the property name with "cmake_", and it it can be + // a list, write it cmake-formatted. + xml.EndElement(); // </property> + } + xml.EndElement(); // </properties> + // Note: compressed test output is unconditionally disabled when // --output-junit is specified. xml.Element("system-out", result.Output); |