diff options
| author | Vaibhav Jain <vaibhav@linux.ibm.com> | 2026-06-26 14:28:06 +0530 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2026-06-29 15:48:26 -0600 |
| commit | 0efe609ef5b6ab286ec296369365efd2b9ce774f (patch) | |
| tree | 1071b3cf8f863e9f5c2f8cac38a1a80f55a5888b /scripts/Makefile.thinlto | |
| parent | dc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff) | |
| download | linux-next-0efe609ef5b6ab286ec296369365efd2b9ce774f.tar.gz linux-next-0efe609ef5b6ab286ec296369365efd2b9ce774f.zip | |
kunit,rust: Add ability to skip entire test suites
Currently, KUnit provides mechanisms to skip individual test cases, but
there is no way to skip an entire test suite based on runtime conditions
checked during suite initialization. This limitation forces test suites
to either fail or skip tests individually when certain prerequisites are
not available.
To address this limitation, the patch adds a 'status' field to struct
kunit_suite that allows suite_init callbacks to mark the entire suite as
KUNIT_SKIPPED. When a suite is marked as skipped, all test cases within
that suite are bypassed without execution.
The patch proposed changes to kunit_suite_has_succeeded() to Check suite
status before evaluating individual test case results. Also
kunit_run_tests() is updated to skip suite execution if kunit_suite's
'status' is KUNIT_SKIPPED, thats either set before suite_init or by the
suite_init callback itself. kunit_init_suite() is updated to initialize the
'status' of kunit_suite to KUNIT_SUCCESS so that any skipped suite's can be
restarted from debugfs.
This enables test suites to perform runtime capability checks in their
'suite_init' callback and gracefully skip all tests when prerequisites are
not met, rather than reporting failures or requiring each test case to
perform redundant checks. In case a kunit-suite is skipped it can be re-run
from the kunit's debugfs interface.
Also update debugfs_print_results() to clearly log the kunit-suite as
'SKIP'. kunit_suite_has_succeeded() is also updated on which
debugfs_print_results() depends to update 'kunit_suite.status' in case any
of the kunit_case has failed.
Finally, update KUnit Rust binding macro-rule 'kunit_unsafe_test_suite' to
add and initialize the newly introduced 'kunit_suite.status'. Without this
'kunit_suite.status' field is never initialized which is an error for the
Rust compiler.
Link: https://patchwork.kernel.org/project/linux-kselftest/patch/20260626085811.151133-2-vaibhav@linux.ibm.com/mbox/
Reviewed-by: David Gow <david@davidgow.net>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
