浏览代码

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
Frank Winklmeier 2 年之前
父节点
当前提交
6ef54e0272
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Source/CTest/cmCTestTestHandler.cxx

+ 1 - 1
Source/CTest/cmCTestTestHandler.cxx

@@ -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>
     }