If a subtest itself reports success, but the outer testcase fails, the whole testcase should be reported as a failure. However the status is recalculated based on the test counts, overwriting the outer test result. Synthesize a failed test in this case to make sure the failure is not swallowed.
These patches where previously part of my KUnit UAPI series [0]. I split them out, as they are useful on their own and the KUnit UAPI series does not actually have a hard dependency on them.
[0] https://lore.kernel.org/lkml/20250717-kunit-kselftests-v5-0-442b711cde2e@lin...
Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de --- Thomas Weißschuh (2): kunit: tool: Add test for nested test result reporting kunit: tool: Don't overwrite test status based on subtest counts
tools/testing/kunit/kunit_parser.py | 3 +++ tools/testing/kunit/kunit_tool_test.py | 11 +++++++++++ .../kunit/test_data/test_is_test_passed-failure-nested.log | 10 ++++++++++ 3 files changed, 24 insertions(+) --- base-commit: a77b19b747c8a53ac16289685b0f77085a2ad553 change-id: 20251230-kunit-nested-failure-a3a56ec999ba
Best regards,