[PATCH 1/2] selftests: kselftest: Added yaml output to kselftest.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alice Ferrazzi <alice.ferrazzi@xxxxxxxxx>

Added reason to test_result function

Signed-off-by: Alice Ferrazzi <alice.ferrazzi@xxxxxxxxx>
---
 tools/testing/selftests/kselftest.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 1d874a50d9..218571f0c6 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -54,22 +54,28 @@ static inline void ksft_print_cnts(void)
 	printf("1..%d\n", ksft_test_num());
 }
 
-static inline void ksft_test_result_pass(const char *msg)
+static inline void ksft_test_result_pass(const char *msg, const char *reason)
 {
 	ksft_cnt.ksft_pass++;
 	printf("ok %d %s\n", ksft_test_num(), msg);
+	if (reason)
+		printf(" ---\n reason: \"%s\"\n ...\n", reason);
 }
 
-static inline void ksft_test_result_fail(const char *msg)
+static inline void ksft_test_result_fail(const char *msg, const char *reason)
 {
 	ksft_cnt.ksft_fail++;
 	printf("not ok %d %s\n", ksft_test_num(), msg);
+	if (reason)
+		printf(" ---\n reason: \"%s\"\n ...\n", reason);
 }
 
-static inline void ksft_test_result_skip(const char *msg)
+static inline void ksft_test_result_skip(const char *msg, const char *reason)
 {
 	ksft_cnt.ksft_xskip++;
 	printf("ok %d # skip %s\n", ksft_test_num(), msg);
+	if (reason)
+		printf(" ---\n reason: \"%s\"\n ...\n", reason);
 }
 
 static inline int ksft_exit_pass(void)
-- 
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux