CTest: add test failure reason to JUnit XML output

In case of test failure, add the test failure reason (e.g. "Timeout") to
the failure message in the XML file. This is the same value that is
shown in the ctest text output.

Fixes: #24184
This commit is contained in:
Frank Winklmeier
2023-02-02 16:49:17 +01:00
parent 063913f486
commit 6ef54e0272

View File

@@ -2569,7 +2569,7 @@ bool cmCTestTestHandler::WriteJUnitXML()
xml.EndElement(); // </skipped>
} else if (status == "fail") {
xml.StartElement("failure");
xml.Attribute("message", result.Reason);
xml.Attribute("message", this->GetTestStatus(result));
xml.EndElement(); // </failure>
}