Skip to content

Commit

Permalink
Merge pull request #11650 from /issues/20111
Browse files Browse the repository at this point in the history
Dump the test's full output to the xUnit output xml file
  • Loading branch information
mariospr authored Dec 20, 2021
2 parents 8fe8a27 + 2163e59 commit 400b00d
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions chromium_src/base/test/launcher/test_results_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@
// Upstream deliberately avoids including the failure's details and stack trace
// in the result XML for the xUnit format, so we need to add it explicitly to be
// able to visualize the data directly from Jenkins for each failed test.
#define TEST_RESULTS_TRACKER_ADD_FAILURE_DETAILS \
std::string failure_data; \
for (const TestResultPart& result_part : result.test_result_parts) { \
failure_data += StringPrintf( \
"Failure at %s (line %d):\n\n%s\n\n", result_part.file_name.c_str(), \
result_part.line_number, result_part.message.c_str()); \
} \
fprintf(out_, \
" <failure message=\"[ FAILED ] %s.%s\" " \
"type=\"\"><![CDATA[%s]]></failure>\n", \
testsuite_name.c_str(), result.GetTestName().c_str(), \
failure_data.c_str());
#define TEST_RESULTS_TRACKER_ADD_FAILURE_DETAILS \
fprintf(out_, \
" <failure message=\"[ FAILED ] %s.%s\" " \
"type=\"\"><![CDATA[%s]]></failure>\n", \
testsuite_name.c_str(), result.GetTestName().c_str(), \
result.output_snippet.c_str());

#include "src/base/test/launcher/test_results_tracker.cc"

Expand Down

0 comments on commit 400b00d

Please sign in to comment.