mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
perf tests: Include error output for skipped tests in JUnit XML
The JUnit XML output correctly captures the stderr/stdout output of failed tests inside the <failure> element. However, for skipped tests, the output was completely discarded and the XML only received a self-closing <skipped message="reason"/> tag. This expands the <skipped> element to include the test's err_output when available, which is extremely helpful for debugging why a test was skipped (e.g. diagnosing missing prerequisites or unexpected environment states that triggered the skip) directly from CI systems parsing the XML report. Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
b02e597450
commit
f6e5090f63
|
|
@ -536,8 +536,14 @@ static int print_test_result(struct test_suite *t, int curr_suite, int curr_test
|
|||
const char *reason = skip_reason(t, curr_test_case);
|
||||
char *escaped_reason = xml_escape(reason ? reason : "Skip");
|
||||
|
||||
strbuf_addf(&junit_xml_buf, " <skipped message=\"%s\"/>\n",
|
||||
escaped_reason);
|
||||
if (err_output && *err_output) {
|
||||
strbuf_addf(&junit_xml_buf,
|
||||
" <skipped message=\"%s\">\n%s\n </skipped>\n",
|
||||
escaped_reason, escaped_err);
|
||||
} else {
|
||||
strbuf_addf(&junit_xml_buf, " <skipped message=\"%s\"/>\n",
|
||||
escaped_reason);
|
||||
}
|
||||
free(escaped_reason);
|
||||
}
|
||||
strbuf_addstr(&junit_xml_buf, " </testcase>\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user