From 454809f23423cd8eae98a2d80d3f2073f1008f37 Mon Sep 17 00:00:00 2001 From: Yi Sun Date: Thu, 16 Nov 2023 10:50:41 +0800 Subject: [PATCH 1/2] common/kselftest.h: Change the format of the results lines Make the results more significant. Signed-off-by: Yi Sun --- common/kselftest.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/kselftest.h b/common/kselftest.h index 33a0dbd2..20694110 100644 --- a/common/kselftest.h +++ b/common/kselftest.h @@ -152,10 +152,11 @@ static inline void ksft_test_result_pass(const char *msg, ...) ksft_cnt.ksft_pass++; va_start(args, msg); - printf("ok %d ", ksft_test_num()); + printf("%d: ", ksft_test_num()); errno = saved_errno; vprintf(msg, args); va_end(args); + printf(": [PASS]\n"); } static inline void ksft_test_result_fail(const char *msg, ...) @@ -166,10 +167,11 @@ static inline void ksft_test_result_fail(const char *msg, ...) ksft_cnt.ksft_fail++; va_start(args, msg); - printf("not ok %d ", ksft_test_num()); + printf("%d: ", ksft_test_num()); errno = saved_errno; vprintf(msg, args); va_end(args); + printf(": [FAIL]\n"); } /** From 9d75df819bcf628b8f12ad876cc116dc04706b53 Mon Sep 17 00:00:00 2001 From: Yi Sun Date: Thu, 16 Nov 2023 10:53:14 +0800 Subject: [PATCH 2/2] xsave: Change the results output. Align with the new output format. Signed-off-by: Yi Sun --- xsave/xstate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xsave/xstate.c b/xsave/xstate.c index 223e9a48..8da301cc 100644 --- a/xsave/xstate.c +++ b/xsave/xstate.c @@ -98,9 +98,9 @@ static void compare_buf_result(struct xsave_buffer *valid_buf, const char *case_name) { if (memcmp(&valid_buf->bytes[0], &compare_buf->bytes[0], xstate_size)) - ksft_test_result_fail("The case: %s.\n", case_name); + ksft_test_result_fail("%s", case_name); else - ksft_test_result_pass("The case: %s.\n", case_name); + ksft_test_result_pass("%s", case_name); } static void test_xstate_sig_handle(void) @@ -132,9 +132,9 @@ static void test_xstate_fork(void) /* Child process xstate should be same as the parent process xstate. */ if (xstate_fork(valid_xbuf, compared_xbuf, xstate_info.mask, xstate_size)) { - ksft_test_result_pass("The case: %s.\n", case_name2); + ksft_test_result_pass("%s", case_name2); } else { - ksft_test_result_fail("The case: %s.\n", case_name2); + ksft_test_result_fail("%s", case_name2); } /* The parent process xstate should not change after context switch. */