[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240220192235.2953484-10-kuba@kernel.org>
Date: Tue, 20 Feb 2024 11:22:33 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
shuah@...nel.org,
linux-kselftest@...r.kernel.org,
mic@...ikod.net,
linux-security-module@...r.kernel.org,
keescook@...omium.org,
jakub@...udflare.com,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH net-next v3 09/11] 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.
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
tools/testing/selftests/kselftest_harness.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 6157a7b059c6..7c3d19bf4220 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -1147,14 +1147,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);
+ ksft_test_result_code(t->exit_code, test_name,
+ diagnostic ? "%s" : "", diagnostic);
}
static int test_harness_run(int argc, char **argv)
--
2.43.0
Powered by blists - more mailing lists