]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kunit: tool: Recommend --raw_output=all if no KTAP found
authorDavid Gow <david@davidgow.net>
Fri, 27 Feb 2026 10:56:49 +0000 (18:56 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 Apr 2026 19:47:52 +0000 (13:47 -0600)
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?"

Signed-off-by: David Gow <david@davidgow.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/kunit/kunit_parser.py

index 5338489dcbe48c01912c5e8f02a481d6860a5d15..1c61a0ed740d4b0a2dcde22d2bf4efc2ed530cf4 100644 (file)
@@ -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)