aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/kunit/kunit_parser.py
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2022-03-29 14:42:48 -0700
committerShuah Khan <skhan@linuxfoundation.org>2022-05-12 11:15:58 -0600
commit9660209d9418f2295d31fea0d32e313e9b2c1200 (patch)
tree57ad822494fae14bfe479cf9b0350bea6ed84d61 /tools/testing/kunit/kunit_parser.py
parentkunit: tool: stop using a shell to run kernel under QEMU (diff)
downloadlinux-dev-9660209d9418f2295d31fea0d32e313e9b2c1200.tar.xz
linux-dev-9660209d9418f2295d31fea0d32e313e9b2c1200.zip
kunit: tool: print clearer error message when there's no TAP output
Before: $ ./tools/testing/kunit/kunit.py parse /dev/null ... [ERROR] Test : invalid KTAP input! After: $ ./tools/testing/kunit/kunit.py parse /dev/null ... [ERROR] Test <missing>: could not find any KTAP output! This error message gets printed out when extract_tap_output() yielded no lines. So while it could be because of malformed KTAP output from KUnit, it could also be due to not having any KTAP output at all. Try and make the error message here more clear. Signed-off-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: David Gow <davidgow@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit/kunit_parser.py')
-rw-r--r--tools/testing/kunit/kunit_parser.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py
index de1c0b7e14ed..e16331a5bec4 100644
--- a/tools/testing/kunit/kunit_parser.py
+++ b/tools/testing/kunit/kunit_parser.py
@@ -824,7 +824,8 @@ def parse_run_tests(kernel_output: Iterable[str]) -> Test:
lines = extract_tap_lines(kernel_output)
test = Test()
if not lines:
- test.add_error('invalid KTAP input!')
+ test.name = '<missing>'
+ test.add_error('could not find any KTAP output!')
test.status = TestStatus.FAILURE_TO_PARSE_TESTS
else:
test = parse_test(lines, 0, [])