netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: jakub@cloudflare.com
Cc: shuah@kernel.org, keescook@chromium.org,
	linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
	Jakub Kicinski <kuba@kernel.org>
Subject: [RFC 0/7] selftests: kselftest_harness: use common result printing helper
Date: Thu, 15 Feb 2024 16:41:15 -0800	[thread overview]
Message-ID: <20240216004122.2004689-1-kuba@kernel.org> (raw)

Add a common result printing helper and always include test name
in the result line. Previously when SKIP or XPASS would happen
we printed:

  ok 1 # SKIP unknown

without the test name. Now we'll print:

  ok 1 global.no_pad # SKIP unknown

This appears to be more inline with:
https://docs.kernel.org/dev-tools/ktap.html
and makes parsing results easier.

First 3 patches rearrange kselftest_harness to use exit code
as an enum rather than separate passed/skip/xfail members.

Rest of the series builds a ksft_test_result_code() helper.

This series is on top of:
https://lore.kernel.org/all/20240216002619.1999225-1-kuba@kernel.org/

Jakub Kicinski (7):
  selftests: kselftest_harness: generate test name once
  selftests: kselftest_harness: save full exit code in metadata
  selftests: kselftest_harness: use exit code to store skip and xfail
  selftests: kselftest: add ksft_test_result_code(), handling all exit
    codes
  selftests: kselftest_harness: print test name for SKIP and XFAIL
  selftests: kselftest_harness: let ksft_test_result_code() handle line
    termination
  selftests: kselftest_harness: let PASS / FAIL provide diagnostic

 tools/testing/selftests/kselftest.h         | 45 ++++++++++
 tools/testing/selftests/kselftest_harness.h | 96 ++++++++++-----------
 tools/testing/selftests/net/tls.c           |  2 +-
 3 files changed, 91 insertions(+), 52 deletions(-)

-- 
2.43.0


             reply	other threads:[~2024-02-16  0:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16  0:41 Jakub Kicinski [this message]
2024-02-16  0:41 ` [RFC 1/7] selftests: kselftest_harness: generate test name once Jakub Kicinski
2024-02-16 21:24   ` Kees Cook
2024-02-16  0:41 ` [RFC 2/7] selftests: kselftest_harness: save full exit code in metadata Jakub Kicinski
2024-02-16  0:41 ` [RFC 3/7] selftests: kselftest_harness: use exit code to store skip and xfail Jakub Kicinski
2024-02-16  0:41 ` [RFC 4/7] selftests: kselftest: add ksft_test_result_code(), handling all exit codes Jakub Kicinski
2024-02-16  0:41 ` [RFC 5/7] selftests: kselftest_harness: print test name for SKIP and XFAIL Jakub Kicinski
2024-02-16  0:41 ` [RFC 6/7] selftests: kselftest_harness: let ksft_test_result_code() handle line termination Jakub Kicinski
2024-02-16  0:41 ` [RFC 7/7] selftests: kselftest_harness: let PASS / FAIL provide diagnostic Jakub Kicinski
2024-02-16 21:32 ` [RFC 0/7] selftests: kselftest_harness: use common result printing helper Kees Cook
2024-02-17  0:31   ` Jakub Kicinski
2024-02-17  0:33     ` Jakub Kicinski
2024-02-17  1:26       ` Jakub Kicinski
2024-02-17  1:48         ` Kees Cook

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=20240216004122.2004689-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=jakub@cloudflare.com \
    --cc=keescook@chromium.org \
    --cc=linux-kselftest@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).