diff options
| author | Sarthak Sharma <sarthak.sharma@arm.com> | 2026-04-27 16:54:47 +0530 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2026-04-27 10:48:24 -0600 |
| commit | 74f192205c48333de054620a79d7ce9f4515fb0b (patch) | |
| tree | a8317db0f0e2f8465d02c9b712900fa05f9847e7 /tools | |
| parent | 254f49634ee16a731174d2ae34bc50bd5f45e731 (diff) | |
selftests: kselftest: fix wrong test number in ksft_exit_skip
ksft_exit_skip() increments ksft_xskip before printing the KTAP
result. As a result, ksft_test_num() already includes the skipped
test.
Adding 1 to ksft_test_num() increments the printed test number
again, producing an incorrect test number and wrong KTAP output.
Drop the extra increment and print ksft_test_num() directly.
Link: https://lore.kernel.org/r/20260427112447.147985-1-sarthak.sharma@arm.com
Fixes: b85d387c9b09 ("kselftest: fix TAP output for skipped tests")
Signed-off-by: Sarthak Sharma <sarthak.sharma@arm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/selftests/kselftest.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index 6d809f08ab7b..60838b61a2da 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -450,7 +450,7 @@ static inline __noreturn __printf(1, 2) void ksft_exit_skip(const char *msg, ... */ if (ksft_plan || ksft_test_num()) { ksft_cnt.ksft_xskip++; - printf("ok %u # SKIP ", 1 + ksft_test_num()); + printf("ok %u # SKIP ", ksft_test_num()); } else { printf("1..0 # SKIP "); } |
