OpenCloudOS-Kernel/tools/testing/kunit/test_data
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
..
test_config_printk_time.log kunit: tools: fix kunit_tool tests for parsing test plans 2020-10-26 13:25:40 -06:00
test_insufficient_memory.log kunit: show error if kunit results are not present 2020-06-26 14:29:10 -06:00
test_interrupted_tap_output.log kunit: tools: fix kunit_tool tests for parsing test plans 2020-10-26 13:25:40 -06:00
test_is_test_passed-all_passed.log kunit: test: add test plan to KUnit TAP format 2020-10-09 14:37:49 -06:00
test_is_test_passed-crash.log kunit: test: add test plan to KUnit TAP format 2020-10-09 14:37:49 -06:00
test_is_test_passed-failure.log kunit: test: add test plan to KUnit TAP format 2020-10-09 14:37:49 -06:00
test_is_test_passed-no_tests_run_no_header.log kunit: tool: Fix error messages for cases of no tests and wrong TAP header 2021-07-12 13:53:05 -06:00
test_is_test_passed-no_tests_run_with_header.log kunit: tool: Fix error messages for cases of no tests and wrong TAP header 2021-07-12 13:53:05 -06:00
test_kernel_panic_interrupt.log kunit: tools: fix kunit_tool tests for parsing test plans 2020-10-26 13:25:40 -06:00
test_multiple_prefixes.log kunit: tools: fix kunit_tool tests for parsing test plans 2020-10-26 13:25:40 -06:00
test_output_isolated_correctly.log
test_output_with_prefix_isolated_correctly.log
test_pound_no_prefix.log kunit: tools: fix kunit_tool tests for parsing test plans 2020-10-26 13:25:40 -06:00
test_pound_sign.log kunit: tools: fix kunit_tool tests for parsing test plans 2020-10-26 13:25:40 -06:00
test_read_from_file.kconfig
test_skip_all_tests.log kunit: tool: Support skipped tests in kunit_tool 2021-06-25 11:31:03 -06:00
test_skip_tests.log kunit: tool: Support skipped tests in kunit_tool 2021-06-25 11:31:03 -06:00