@@ -287,10 +287,15 @@ void ksft_test_result_code(int exit_code, const char *test_name,
break;
}
+ /* Docs seem to call for double space if directive is absent */
+ if (!directive[0] && msg[0])
+ directive = " # ";
+
va_start(args, msg);
printf("%s %u %s%s", tap_code, ksft_test_num(), test_name, directive);
errno = saved_errno;
vprintf(msg, args);
+ printf("\n");
va_end(args);
}
@@ -1179,7 +1179,7 @@ void __run_test(struct __fixture_metadata *f,
if (t->exit_code == KSFT_SKIP || t->exit_code == KSFT_XFAIL)
ksft_test_result_code(t->exit_code, test_name,
- "%s\n", diagnostic);
+ "%s", diagnostic);
else
ksft_test_result(__test_passed(t), "%s\n", test_name);
}
According to the spec we should always print a # if we add a diagnostic message. Having the caller pass in the new line as part of diagnostic message makes handling this a bit counter-intuitive. Signed-off-by: Jakub Kicinski <kuba@kernel.org> --- tools/testing/selftests/kselftest.h | 5 +++++ tools/testing/selftests/kselftest_harness.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)