Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7419243rwp; Tue, 18 Jul 2023 15:16:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlGwN0vZQep6ZpA8ti+8/AB+bIbfoOEqU2v6TYRV02zUF90fUPHLoik9VSdELyQOB88UzS5u X-Received: by 2002:a2e:884f:0:b0:2b6:e7ce:4e7d with SMTP id z15-20020a2e884f000000b002b6e7ce4e7dmr479285ljj.43.1689718608576; Tue, 18 Jul 2023 15:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689718608; cv=none; d=google.com; s=arc-20160816; b=K0lxkQBr24kDSUel4bTq3KbCtfuYC0+jHcBgxX2btopk1xRQNEs6zvAm6LceliqLRd JNRcWBARsA+Oh11CAJ9Qc1E4aqPGNseNU0Jvh1y5kBDGJbVf/DnCxnvyX6Aaycvr4GXO 1+t+BPIyfyy5BvZmjLW8opPsIDn4z0WFYNtM1bb/MRdYCwvTRJFvofRP0QUp3efLPVYC xHJQlE/0RgGRncedXEb3druURKaUEyfMTo2COnx+ph8T06+ue+X34TgmfuFEksj3JFjX j+WUB4vh4fq8+yZSMvD1/UyK5fp8EIecvwSOf417xHmVmO49G6zRqtzaOX2sbbq8ywA7 G6+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Hk5lq3jYaxw86Aqa7vCmKHQT+Z4CxbVAISPuGzYNv84=; fh=0DdKI3uRySxQzlTRy49d6VQh77umZfyWRaD7hOgQCS0=; b=Wd4ZD0k551bGJIRQDFNCDh7kEo74qTKmddW07kFNeDiBGsGUNu7T2yO3A11roY1PJE UM9z3yQKDnP/cU/xfYKXoXiW55nMH9VlUFghVk27jnWyxk3+SQj5BDjNs6bhGfjEl7VP Y3VnsUnvA3jhyHLPXpczuGI3BzJ0lgMPVaHlHCnO8yb45iWpy4vbTuk/hsUDl2SIXUkR W7vk0vZADRrndIzJGgJ0+Bq+487kdy/tDe+2MHRIrnsZ50IW6IxFqJmIBE9UcDNpbV2a 3a6JBT3Lc+dDW+xZ50683Rmc4enFw5gwOqtEUw1Vn6/E91EuuzACEsm4INB4BKm+m+kl YD2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fXmwJwiz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ch12-20020a170906c2cc00b0098dfd35276esi1685863ejb.1055.2023.07.18.15.16.23; Tue, 18 Jul 2023 15:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fXmwJwiz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbjGRWGT (ORCPT + 99 others); Tue, 18 Jul 2023 18:06:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231499AbjGRWGP (ORCPT ); Tue, 18 Jul 2023 18:06:15 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46951BF0; Tue, 18 Jul 2023 15:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1689717870; bh=n5xdrpXeznyuCE7mSG3Ebft0BriBP+01pglPR/8sL2I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fXmwJwizASNAM6mEBJEdpCnzy27ei/zjSleHHHPcRvFOJgTXpijOru0Ek4OhJLoHS 13LaD5Vthd3HCTGUSe+L1gA0dGORMT2oQXgNuUeMiYHqbQi0ZM4Xq5eVWQozmTx2cx 5CrKfyPm8NMlLLM5Xd6HM5nTxjHIlr8EtPt+Dq/8= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 19 Jul 2023 00:00:44 +0200 Subject: [PATCH RFC 6/7] kselftest: support skipping tests with testname MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230719-nolibc-ktap-tmp-v1-6-930bd0c52ff1@weissschuh.net> References: <20230719-nolibc-ktap-tmp-v1-0-930bd0c52ff1@weissschuh.net> In-Reply-To: <20230719-nolibc-ktap-tmp-v1-0-930bd0c52ff1@weissschuh.net> To: Willy Tarreau Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1689717869; l=1122; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=n5xdrpXeznyuCE7mSG3Ebft0BriBP+01pglPR/8sL2I=; b=4vAZFZKM8Ci22et/DmKgd0sLHEKdvXcU1n0xEOxws/408WmQBhmwPv4b8y1gWVR9tjrYi2Fb1 avm6PU6beIYAlszszL2ixKFZIXML3KRYN1r59KSQGk0HApXvLnPCBEv X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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