aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/kunit/kunit.py
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2022-08-10 16:02:58 -0700
committerShuah Khan <skhan@linuxfoundation.org>2022-09-30 13:17:17 -0600
commita15cfa39e8cf9bb20d755978c2f25a9c427bf7b2 (patch)
tree0ee4bdc6fa043c6b6d0d1219225019c2b52999e1 /tools/testing/kunit/kunit.py
parentLinux 6.0-rc7 (diff)
downloadwireguard-linux-a15cfa39e8cf9bb20d755978c2f25a9c427bf7b2.tar.xz
wireguard-linux-a15cfa39e8cf9bb20d755978c2f25a9c427bf7b2.zip
kunit: tool: make --raw_output=kunit (aka --raw_output) preserve leading spaces
With $ kunit.py run --raw_output=all ... you get the raw output from the kernel, e.g. something like > TAP version 14 > 1..26 > # Subtest: time_test_cases > 1..1 > ok 1 - time64_to_tm_test_date_range > ok 1 - time_test_cases But --raw_output=kunit or equivalently --raw_output, you get > TAP version 14 > 1..26 > # Subtest: time_test_cases > 1..1 > ok 1 - time64_to_tm_test_date_range > ok 1 - time_test_cases It looks less readable in my opinion, and it also isn't "raw output." This is due to sharing code with kunit_parser.py, which wants to strip leading whitespace since it uses anchored regexes. We could update the kunit_parser.py code to tolerate leaading spaces, but this patch takes the easier way out and adds a bool flag. Signed-off-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit/kunit.py')
-rwxr-xr-xtools/testing/kunit/kunit.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index e132b0654029..161a3b1b0217 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -206,7 +206,7 @@ def parse_tests(request: KunitParseRequest, metadata: kunit_json.Metadata, input
if request.raw_output == 'all':
pass
elif request.raw_output == 'kunit':
- output = kunit_parser.extract_tap_lines(output)
+ output = kunit_parser.extract_tap_lines(output, lstrip=False)
for line in output:
print(line.rstrip())