]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
kunit: Don't fail test suites if one of them is empty
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 15 Oct 2020 16:28:17 +0000 (19:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:00 +0000 (19:22 +0100)
[ Upstream commit 3fc48259d5250f7a3ee021ad0492b604c428c564 ]

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>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/kunit/kunit_parser.py

index 62a08486996716ad6c80c4251432cd55012c4b03..91036d5d51cf6f8d81b3009c7912691866fe7213 100644 (file)
@@ -232,7 +232,7 @@ def parse_test_suite(lines: List[str]) -> 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)