From: Shuah Khan <skhan@linuxfoundation.org>
To: Sarthak Sharma <sarthak.sharma@arm.com>, shuah@kernel.org
Cc: pbonzini@redhat.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests: kselftest: fix wrong test number in ksft_exit_skip
Date: Mon, 27 Apr 2026 11:44:56 -0600 [thread overview]
Message-ID: <7b424355-58bf-470f-ab5a-071ef9c5646f@linuxfoundation.org> (raw)
In-Reply-To: <20260427112447.147985-1-sarthak.sharma@arm.com>
On 4/27/26 05:24, Sarthak Sharma wrote:
> 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.
I applied this patch to linux-kselftest fixes branch.
I ran a few tests and couldn't really see the problem this patch
fixes with and without the patch.
Can you send me before and after for mm or timers test runs?
>
> Fixes: b85d387c9b09 ("kselftest: fix TAP output for skipped tests")
> Signed-off-by: Sarthak Sharma <sarthak.sharma@arm.com>
> ---
> tools/testing/selftests/kselftest.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
> index afbcf8412ae5..827b47cf4df8 100644
> --- a/tools/testing/selftests/kselftest.h
> +++ b/tools/testing/selftests/kselftest.h
> @@ -449,7 +449,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 ");
> }
thanks,
-- Shuah
next prev parent reply other threads:[~2026-04-27 17:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 11:24 [PATCH] selftests: kselftest: fix wrong test number in ksft_exit_skip Sarthak Sharma
2026-04-27 17:44 ` Shuah Khan [this message]
2026-04-28 5:10 ` Sarthak Sharma
2026-05-04 17:58 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7b424355-58bf-470f-ab5a-071ef9c5646f@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=sarthak.sharma@arm.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox