All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>
Cc: "Zhangjin Wu" <falcon@tinylab.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH RFC 6/7] kselftest: support skipping tests with testname
Date: Wed, 19 Jul 2023 00:00:44 +0200	[thread overview]
Message-ID: <20230719-nolibc-ktap-tmp-v1-6-930bd0c52ff1@weissschuh.net> (raw)
In-Reply-To: <20230719-nolibc-ktap-tmp-v1-0-930bd0c52ff1@weissschuh.net>

The TAP parser at tools/testing/kunit/kunit.py requires a testname to
properly parse skipped tests.
The current kselftest APIs do not provide this functionality so add it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 tools/testing/selftests/kselftest.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 811d720d50dd..0206287de5b8 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -219,6 +219,21 @@ static inline void ksft_test_result_skip(const char *msg, ...)
 	va_end(args);
 }
 
+static inline void ksft_test_result_skip2(const char *name, const char *msg, ...)
+{
+	int saved_errno = errno;
+	va_list args;
+
+	ksft_cnt.ksft_xskip++;
+
+	va_start(args, msg);
+	printf("ok %d %s # SKIP ", ksft_test_num(), name);
+	errno = saved_errno;
+	vprintf(msg, args);
+	va_end(args);
+}
+
+
 /* TODO: how does "error" differ from "fail" or "skip"? */
 static inline void ksft_test_result_error(const char *msg, ...)
 {

-- 
2.41.0


  parent reply	other threads:[~2023-07-18 22:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 22:00 [PATCH RFC 0/7] selftests/nolibc: KTAP output Thomas Weißschuh
2023-07-18 22:00 ` [PATCH RFC 1/7] selftests/nolibc: statically calculate number of testsuites Thomas Weißschuh
2023-07-18 22:00 ` [PATCH RFC 2/7] selftests/nolibc: use unsigned indices for testcases Thomas Weißschuh
2023-07-18 22:00 ` [PATCH RFC 3/7] selftests/nolibc: replace repetitive test structure with macro Thomas Weißschuh
2023-07-18 22:00 ` [PATCH RFC 4/7] selftests/nolibc: count subtests Thomas Weißschuh
2023-07-18 22:00 ` [PATCH RFC 5/7] kselftest: support KTAP format Thomas Weißschuh
2023-07-18 22:00 ` Thomas Weißschuh [this message]
2023-07-18 22:00 ` [PATCH RFC 7/7] selftests/nolibc: proof of concept for TAP output Thomas Weißschuh
2023-07-20 15:29   ` Zhangjin Wu
2023-07-21 13:06     ` Thomas Weißschuh

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=20230719-nolibc-ktap-tmp-v1-6-930bd0c52ff1@weissschuh.net \
    --to=linux@weissschuh.net \
    --cc=falcon@tinylab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=w@1wt.eu \
    /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.