kunit: tool: fix count of tests if late test plan
authorRae Moar <rmoar@google.com>
Wed, 19 Mar 2025 22:33:51 +0000 (22:33 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 8 Apr 2025 20:57:24 +0000 (14:57 -0600)
commit14e594a1fc8b879734f8057a870d28c86a889c5f
treed5329695234eea80d84a4ca323e8ce6717af4181
parent0af2f6be1b4281385b618cb86ad946eded089ac8
kunit: tool: fix count of tests if late test plan

Fix test count with late test plan.

For example,
  TAP version 13
  ok 1 test1
  1..4

Returns a count of 1 passed, 1 crashed (because it expects tests after
the test plan): returning the total count of 2 tests

Change this to be 1 passed, 1 error: total count of 1 test

Link: https://lore.kernel.org/r/20250319223351.1517262-1-rmoar@google.com
Signed-off-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <shuah@kernel.org>
tools/testing/kunit/kunit_parser.py
tools/testing/kunit/kunit_tool_test.py