mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 07:31:29 +00:00
selftests: kselftest_harness: let PASS / FAIL provide diagnostic
Switch to printing KTAP line for PASS / FAIL with ksft_test_result_code(), this gives us the ability to report diagnostic messages. Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
42ab727eb9
commit
378193eff3
@ -1143,14 +1143,13 @@ void __run_test(struct __fixture_metadata *f,
|
||||
|
||||
if (t->results->reason[0])
|
||||
diagnostic = t->results->reason;
|
||||
else if (t->exit_code == KSFT_PASS || t->exit_code == KSFT_FAIL)
|
||||
diagnostic = NULL;
|
||||
else
|
||||
diagnostic = "unknown";
|
||||
|
||||
if (t->exit_code == KSFT_SKIP)
|
||||
ksft_test_result_code(t->exit_code, test_name,
|
||||
"%s", diagnostic);
|
||||
else
|
||||
ksft_test_result(__test_passed(t), "%s\n", test_name);
|
||||
diagnostic ? "%s" : "", diagnostic);
|
||||
}
|
||||
|
||||
static int test_harness_run(int argc, char **argv)
|
||||
|
Loading…
Reference in New Issue
Block a user