linux-stable/lib/kunit
Janusz Krzysztofik c95e7c05c1 kunit: Report the count of test suites in a module
According to KTAP specification[1], results should always start from a
header that provides a TAP protocol version, followed by a test plan with
a count of items to be executed.  That pattern should be followed at each
nesting level.  In the current implementation of the top-most, i.e., test
suite level, those rules apply only for test suites built into the kernel,
executed and reported on boot.  Results submitted to dmesg from kunit test
modules loaded later are missing those top-level headers.

As a consequence, if a kunit test module provides more than one test suite
then, without the top level test plan, external tools that are parsing
dmesg for kunit test output are not able to tell how many test suites
should be expected and whether to continue parsing after complete output
from the first test suite is collected.

Submit the top-level headers also from the kunit test module notifier
initialization callback.

v3: Fix new name of a structure moved to kunit namespace not updated in
    executor_test functions (lkp@intel.com).
v2: Use kunit_exec_run_tests() (Mauro, Rae), but prevent it from
    emitting the headers when called on load of non-test modules.

[1] https://docs.kernel.org/dev-tools/ktap.html#

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rae Moar <rmoar@google.com>
Reviewed-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-08-08 13:46:05 -06:00
..
.kunitconfig kunit: tool: make --kunitconfig accept dirs, add lib/kunit fragment 2021-04-02 14:14:36 -06:00
assert.c kunit: fix bug in KUNIT_EXPECT_MEMEQ 2023-01-30 14:46:46 -07:00
attributes.c kunit: fix uninitialized variables bug in attributes filtering 2023-08-04 13:41:55 -06:00
debugfs.c kunit: include debugfs header file 2023-06-09 17:44:16 -07:00
debugfs.h kunit: add debugfs /sys/kernel/debug/kunit/<suite>/results display 2020-03-26 14:07:18 -06:00
executor.c kunit: Report the count of test suites in a module 2023-08-08 13:46:05 -06:00
executor_test.c kunit: Report the count of test suites in a module 2023-08-08 13:46:05 -06:00
hooks-impl.h kunit: Add printf attribute to fail_current_test_impl 2023-02-08 18:08:14 -07:00
hooks.c kunit: Add "hooks" to call into KUnit when it's built as a module 2023-02-08 14:26:25 -07:00
Kconfig kunit: add kunit.enable to enable/disable KUnit test 2022-09-30 13:17:39 -06:00
kunit-example-test.c kunit: Add speed attribute 2023-07-26 13:29:04 -06:00
kunit-test.c kunit: Add kunit_add_action() to defer a call until test exit 2023-05-25 08:52:55 -06:00
Makefile kunit: Add test attributes API structure 2023-07-26 13:28:57 -06:00
resource.c kunit: Add kunit_add_action() to defer a call until test exit 2023-05-25 08:52:55 -06:00
static_stub.c kunit: Expose 'static stub' API to redirect functions 2023-02-08 14:28:17 -07:00
string-stream-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
string-stream.c kunit: alloc_string_stream_fragment error handling bug fix 2022-12-26 16:01:36 -07:00
string-stream.h kunit: drop test pointer in string_stream_fragment 2022-10-07 10:15:33 -06:00
test.c kunit: Report the count of test suites in a module 2023-08-08 13:46:05 -06:00
try-catch-impl.h
try-catch.c kunit: make kunit_test_timeout compatible with comment 2022-03-22 15:57:11 -07:00