linux/tools/testing/kunit
Rae Moar ed01ad3a2f kunit: tool: Fix error messages for cases of no tests and wrong TAP header
This patch addresses misleading error messages reported by kunit_tool in
two cases. First, in the case of TAP output having an incorrect header
format or missing a header, the parser used to output an error message of
'no tests run!'. Now the parser outputs an error message of 'could not
parse test results!'.

As an example:

Before:
$ ./tools/testing/kunit/kunit.py parse /dev/null
[ERROR] no tests run!
...

After:
$ ./tools/testing/kunit/kunit.py parse /dev/null
[ERROR] could not parse test results!
...

Second, in the case of TAP output with the correct header but no
tests, the parser used to output an error message of 'could not parse
test results!'. Now the parser outputs an error message of 'no tests
run!'.

As an example:

Before:
$ echo -e 'TAP version 14\n1..0' | ./tools/testing/kunit/kunit.py parse
[ERROR] could not parse test results!

After:
$ echo -e 'TAP version 14\n1..0' | ./tools/testing/kunit/kunit.py parse
[ERROR] no tests run!

Additionally, this patch also corrects the tests in kunit_tool_test.py
and adds a test to check the error in the case of TAP output with the
correct header but no tests.

Signed-off-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-07-12 13:53:05 -06:00
..
configs kunit: Remove the unused all_tests.config 2021-06-23 17:49:41 -06:00
qemu_configs kunit: tool: add support for QEMU 2021-06-11 16:10:23 -06:00
test_data kunit: tool: Fix error messages for cases of no tests and wrong TAP header 2021-07-12 13:53:05 -06:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kunit_config.py kunit: tool: add support for QEMU 2021-06-11 16:10:23 -06:00
kunit_json.py kunit: tool: surface and address more typing issues 2021-01-15 17:49:34 -07:00
kunit_kernel.py kunit: Move default config from arch/um -> tools/testing/kunit 2021-06-23 17:49:17 -06:00
kunit_parser.py kunit: tool: Fix error messages for cases of no tests and wrong TAP header 2021-07-12 13:53:05 -06:00
kunit_tool_test.py kunit: tool: Fix error messages for cases of no tests and wrong TAP header 2021-07-12 13:53:05 -06:00
kunit.py kunit: tool: add support for QEMU 2021-06-11 16:10:23 -06:00
qemu_config.py kunit: tool: add support for QEMU 2021-06-11 16:10:23 -06:00