Просмотр исходного кода

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 лет назад
Родитель
Сommit
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>
     }