kunit: tool: Recommend --raw_output=all if no KTAP found
David Gow
maintainerPATCH 1/1 kunit: tool: Recommend --raw_output=all if no KTAP found
If no KTAP header is found in the kernel output (e.g., because the kernel crashed before the KUnit executor was run), it's very useful to re-run the test with --raw_output=all, as that will show any error output (such as a stacktrace, log message, BUG, etc). This is not particularly intuitive, however, as --raw_output=all is not well known.
Add an extra log line to advertise --raw_output=all in this case, as it's a terrible user experience to just get "Did any KUnit tests run?"
--- tools/testing/kunit/kunit_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/kunit/kunit_parser.py +2 -1
@@ -857,7 +857,8 @@ def parse_run_tests(kernel_output: Iterable[str], printer: Printer) -> Test: test = Test() if not lines: test.name = '<missing>' - test.add_error(printer, 'Could not find any KTAP output. Did any KUnit tests run?') + test.add_error(printer, 'Could not find any KTAP output. Did any KUnit tests run?\n' + + 'Try running with the --raw_output=all option to see any log messages.') test.status = TestStatus.FAILURE_TO_PARSE_TESTS else: test = parse_test(lines, 0, [], False, printer)
Signature · 1 line
2.53.0
Quoted 8 lines · David Gow
If no KTAP header is found in the kernel output (e.g., because the kernel crashed before the KUnit executor was run), it's very useful to re-run the test with --raw_output=all, as that will show any error output (such as a stacktrace, log message, BUG, etc). This is not particularly intuitive, however, as --raw_output=all is not well known.
Add an extra log line to advertise --raw_output=all in this case, as it's a terrible user experience to just get "Did any KUnit tests run?"
What's the difference to "full"?
Thanks for adding this, btw!
Signature · 2 lines
With Best Regards, Andy Shevchenko
David Gow
maintainerLe 27/02/2026 à 10:46 PM, Andy Shevchenko a écrit :
Quoted 7 lines · David Gow
Quoted 6 lines
If no KTAP header is found in the kernel output (e.g., because the kernel crashed before the KUnit executor was run), it's very useful to re-run the test with --raw_output=all, as that will show any error output (such as a stacktrace, log message, BUG, etc). This is not particularly intuitive, however, as --raw_output=all is not well known.
Quoted 7 lines
Quoted 2 lines
Add an extra log line to advertise --raw_output=all in this case, as it's a terrible user experience to just get "Did any KUnit tests run?"
What's the difference to "full"?
Thanks for adding this, btw!
Normally, the --raw_output option will just pass through the actual test results (or, rather, any kernel output from when the tests are running), by skipping everything prior to the "KTAP version 1" line.
--raw_output=full is a synonym for --raw_output=all, which just passes through all of the kernel output, so is useful if we never get as far as printing that KTAP version line.
(I kept forgetting whether it was "full" or "all", which is why both are supported.)
Cheers,
-- David
Andy Shevchenko
Reviewed-byQuoted 19 lines · David Gow
Le 27/02/2026 à 10:46 PM, Andy Shevchenko a écrit :
Quoted 7 lines · David Gow
Quoted 6 lines
If no KTAP header is found in the kernel output (e.g., because the kernel crashed before the KUnit executor was run), it's very useful to re-run the test with --raw_output=all, as that will show any error output (such as a stacktrace, log message, BUG, etc). This is not particularly intuitive, however, as --raw_output=all is not well known.
Quoted 6 lines
Quoted 2 lines
Add an extra log line to advertise --raw_output=all in this case, as it's a terrible user experience to just get "Did any KUnit tests run?"
What's the difference to "full"?
Thanks for adding this, btw!
Normally, the --raw_output option will just pass through the actual test results (or, rather, any kernel output from when the tests are running), by skipping everything prior to the "KTAP version 1" line.
Quoted 6 lines
--raw_output=full is a synonym for --raw_output=all, which just passes through all of the kernel output, so is useful if we never get as far as printing that KTAP version line.
(I kept forgetting whether it was "full" or "all", which is why both are supported.)
Okay, thanks for elaboration:
Signature · 2 lines
With Best Regards, Andy Shevchenko