diff options
author | David Gow <davidgow@google.com> | 2021-06-24 23:58:12 -0700 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2021-06-25 11:31:03 -0600 |
commit | 6d2426b2f258da19fbe5fa1c93a5695460390eac (patch) | |
tree | d7d61a00ca25fea95d9e7b0e3534dbd0fa1bd7a6 /lib/kunit/debugfs.c | |
parent | 824945a5b0ff8260a568b87968172d728446d8f7 (diff) | |
download | lwn-6d2426b2f258da19fbe5fa1c93a5695460390eac.tar.gz lwn-6d2426b2f258da19fbe5fa1c93a5695460390eac.zip |
kunit: Support skipped tests
The kunit_mark_skipped() macro marks the current test as "skipped", with
the provided reason. The kunit_skip() macro will mark the test as
skipped, and abort the test.
The TAP specification supports this "SKIP directive" as a comment after
the "ok" / "not ok" for a test. See the "Directives" section of the TAP
spec for details:
https://testanything.org/tap-specification.html#directives
The 'success' field for KUnit tests is replaced with a kunit_status
enum, which can be SUCCESS, FAILURE, or SKIPPED, combined with a
'status_comment' containing information on why a test was skipped.
A new 'kunit_status' test suite is added to test this.
Signed-off-by: David Gow <davidgow@google.com>
Tested-by: Marco Elver <elver@google.com>
Reviewed-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/kunit/debugfs.c')
-rw-r--r-- | lib/kunit/debugfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kunit/debugfs.c b/lib/kunit/debugfs.c index 9214c493d8b7..b71db0abc12b 100644 --- a/lib/kunit/debugfs.c +++ b/lib/kunit/debugfs.c @@ -64,7 +64,7 @@ static int debugfs_print_results(struct seq_file *seq, void *v) debugfs_print_result(seq, suite, test_case); seq_printf(seq, "%s %d - %s\n", - kunit_status_to_string(success), 1, suite->name); + kunit_status_to_ok_not_ok(success), 1, suite->name); return 0; } |