diff mbox series

[v1] kunit: Don't fail test suites if one of them is empty

Message ID 20201015162817.86901-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit 3fc48259d5250f7a3ee021ad0492b604c428c564
Headers show
Series [v1] kunit: Don't fail test suites if one of them is empty | expand

Commit Message

Andy Shevchenko Oct. 15, 2020, 4:28 p.m. UTC
Empty test suite is okay test suite.

Don't fail the rest of the test suites if one of them is empty.

Fixes: 6ebf5866f2e8 ("kunit: tool: add Python wrappers for running KUnit tests")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 tools/testing/kunit/kunit_parser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brendan Higgins Oct. 20, 2020, 9:29 p.m. UTC | #1
On Thu, Oct 15, 2020 at 9:28 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Empty test suite is okay test suite.
>
> Don't fail the rest of the test suites if one of them is empty.
>
> Fixes: 6ebf5866f2e8 ("kunit: tool: add Python wrappers for running KUnit tests")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Nice catch! Thanks!

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
diff mbox series

Patch

diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py
index 8019e3dd4c32..12b9fc652ef6 100644
--- a/tools/testing/kunit/kunit_parser.py
+++ b/tools/testing/kunit/kunit_parser.py
@@ -242,7 +242,7 @@  def parse_test_suite(lines: List[str], expected_suite_index: int) -> TestSuite:
 		return None
 	test_suite.name = name
 	expected_test_case_num = parse_subtest_plan(lines)
-	if not expected_test_case_num:
+	if expected_test_case_num is None:
 		return None
 	while expected_test_case_num > 0:
 		test_case = parse_test_case(lines)