All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Jackman <jackmanb@google.com>
To: Hangbin Liu <liuhangbin@gmail.com>, <linux-kselftest@vger.kernel.org>
Cc: Shuah Khan <shuah@kernel.org>,
	Brendan Jackman <jackmanb@google.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCHv3] selftests: Use ktap helpers for runner.sh
Date: Wed, 25 Feb 2026 13:06:47 +0000	[thread overview]
Message-ID: <DGO2DAIFY07Y.367VMZA7XGT4U@google.com> (raw)
In-Reply-To: <20260225010833.11301-1-liuhangbin@gmail.com>

On Wed Feb 25, 2026 at 1:08 AM UTC, Hangbin Liu wrote:
> Instead of manually writing ktap messages, we should use the formal
> ktap helpers in runner.sh. Brendan did some work in d9e6269e3303
> ("selftests/run_kselftest.sh: exit with error if tests fail") to make
> run_kselftest.sh exit with the correct return value. However, the output
> does not include the total results, such as how many tests passed or failed.
>
> Let’s convert all manually printed messages in runner.sh to use the
> formal ktap helpers. Here are what I changed:
>
>   1. Move TAP header from runner.sh to run_kselftest.sh, since run_kselftest.sh
>      is the only caller of run_many().
>   2. In run_kselftest.sh, call run_many() in main process to count the
>      pass/fail numbers.
>   3. In run_kselftest.sh, do not generate kselftest_failures_file. Just
>      use ktap_print_totals to report the result.
>   4. In runner.sh run_one(), get the return value and use ktap helpers for
>      all pass/fail reporting. This allows counting pass/fail numbers in the
>      main process.
>   5. In runner.sh run_in_netns(), also return the correct rc, so we can
>      count results during wait.
>
> After the change, the printed result looks like:
>
>   not ok 4 4 selftests: clone3: clone3_cap_checkpoint_restore # exit=1
>   # Totals: pass:3 fail:1 xfail:0 xpass:0 skip:0 error:0
>
>   ]# echo $?
>   1
>
> Tested-by: Brendan Jackman <jackmanb@google.com>

Thanks,

Reviewed-by: Brendan Jackman <jackmanb@google.com>

  reply	other threads:[~2026-02-25 13:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25  1:08 [PATCHv3] selftests: Use ktap helpers for runner.sh Hangbin Liu
2026-02-25 13:06 ` Brendan Jackman [this message]
2026-03-05  1:56   ` Hangbin Liu
2026-03-11  2:17     ` Hangbin Liu
2026-03-31 20:51 ` Shuah Khan
2026-04-01  1:05   ` Hangbin Liu
  -- strict thread matches above, loose matches on Subject: below --
2026-04-16  8:07 Qingfang Deng
2026-04-17  7:43 ` Hangbin Liu

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=DGO2DAIFY07Y.367VMZA7XGT4U@google.com \
    --to=jackmanb@google.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.