Skip to content

Commit a245882

Browse files
committed
Merge tag 'linux_kselftest-kunit-6.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kunit fixes from Shuah Khan: - Fix the tool to report test count in case of a late test plan when tests are specified before the test plan - Fix spelling error * tag 'linux_kselftest-kunit-6.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: Spelling s/slowm/slow/ kunit: tool: fix count of tests if late test plan
2 parents 0e88632 + d1be0cf commit a245882

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

include/kunit/test.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ enum kunit_status {
6767

6868
/*
6969
* Speed Attribute is stored as an enum and separated into categories of
70-
* speed: very_slowm, slow, and normal. These speeds are relative to
70+
* speed: very_slow, slow, and normal. These speeds are relative to
7171
* other KUnit tests.
7272
*
7373
* Note: unset speed attribute acts as default of KUNIT_SPEED_NORMAL.

tools/testing/kunit/kunit_parser.py

+4
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,10 @@ def parse_test(lines: LineStream, expected_num: int, log: List[str], is_subtest:
809809
test.log.extend(parse_diagnostic(lines))
810810
if test.name != "" and not peek_test_name_match(lines, test):
811811
test.add_error(printer, 'missing subtest result line!')
812+
elif not lines:
813+
print_log(test.log, printer)
814+
test.status = TestStatus.NO_TESTS
815+
test.add_error(printer, 'No more test results!')
812816
else:
813817
parse_test_result(lines, test, expected_num, printer)
814818

tools/testing/kunit/kunit_tool_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ def test_parse_late_test_plan(self):
371371
"""
372372
result = kunit_parser.parse_run_tests(output.splitlines(), stdout)
373373
# Missing test results after test plan should alert a suspected test crash.
374-
self.assertEqual(kunit_parser.TestStatus.TEST_CRASHED, result.status)
375-
self.assertEqual(result.counts, kunit_parser.TestCounts(passed=1, crashed=1, errors=1))
374+
self.assertEqual(kunit_parser.TestStatus.SUCCESS, result.status)
375+
self.assertEqual(result.counts, kunit_parser.TestCounts(passed=1, errors=2))
376376

377377
def line_stream_from_strs(strs: Iterable[str]) -> kunit_parser.LineStream:
378378
return kunit_parser.LineStream(enumerate(strs, start=1))

0 commit comments

Comments
 (0)