From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36399C433DB for ; Wed, 10 Feb 2021 05:06:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF00264E42 for ; Wed, 10 Feb 2021 05:06:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF00264E42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 75BC86B006C; Wed, 10 Feb 2021 00:06:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E0BC6B0070; Wed, 10 Feb 2021 00:06:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F9A36B0071; Wed, 10 Feb 2021 00:06:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 489736B006C for ; Wed, 10 Feb 2021 00:06:02 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 08FEB18478DB5 for ; Wed, 10 Feb 2021 05:06:02 +0000 (UTC) X-FDA: 77801171364.21.drum17_4a0cf2d2760d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id E3C9A184B4AE0 for ; Wed, 10 Feb 2021 05:06:01 +0000 (UTC) X-HE-Tag: drum17_4a0cf2d2760d X-Filterd-Recvd-Size: 4531 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Feb 2021 05:06:01 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 09 Feb 2021 21:05:59 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 10 Feb 2021 05:05:55 +0000 Received: from ubuntu.vdiclient.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Wed, 10 Feb 2021 05:05:53 +0000 From: Timur Tabi To: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Vlastimil Babka , Andy Shevchenko , Matthew Wilcox , , "Linus Torvalds" , , "Kees Cook" , John Ogness , , , Andrey Konovalov , Marco Elver , Rasmus Villemoes , Pavel Machek , , Subject: [PATCH 2/3] kselftest: add support for skipped tests Date: Tue, 9 Feb 2021 23:05:28 -0600 Message-ID: <20210210050529.843005-3-ttabi@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210210050529.843005-1-ttabi@nvidia.com> References: <20210210050529.843005-1-ttabi@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612933559; bh=zziyNFNlmhSW3q56XQBsPtG1JAzI0NtMX6ixBkt95eQ=; h=From:To:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:X-NVConfidentiality:Content-Transfer-Encoding: Content-Type; b=WuvKaTC/TNCklMdz1K6fO9lcupEAM8iorDm0grzyrVo1mbY49/SVyPj5vGk6daZ4J rRliDzP37cebsuJALnMxasmn2wBY1WDF1B9amiof1HqKKZ66KFSri+L/lkUHT7P0Rc Q8BYd8ockVYDukRfdLgHlgaAZiKDajU9Sl6t3C/4H/gnMnuSxNY9F6L/yvIl2ioc0/ 343SsdMWuSJxoarnaxNMDriDATmjtCIDLX+5/7toogK5q87jCYHW9IbUYV3a7aRMND QSdjyudXOnFz0V/hrcO3TbcntXS+iaO5EGmLMSVX+tgdIvKRVro7pvqhtGw6wmZKM4 pwVlPM7v9v30Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Update the kselftest framework to all testing clients to specify that some tests were skipped. Signed-off-by: Timur Tabi --- tools/testing/selftests/kselftest_module.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/kselftest_module.h b/tools/testing/sel= ftests/kselftest_module.h index e8eafaf0941a..e2ea41de3f35 100644 --- a/tools/testing/selftests/kselftest_module.h +++ b/tools/testing/selftests/kselftest_module.h @@ -11,7 +11,8 @@ =20 #define KSTM_MODULE_GLOBALS() \ static unsigned int total_tests __initdata; \ -static unsigned int failed_tests __initdata +static unsigned int failed_tests __initdata; \ +static unsigned int skipped_tests __initdata =20 #define KSTM_CHECK_ZERO(x) do { \ total_tests++; \ @@ -21,11 +22,16 @@ static unsigned int failed_tests __initdata } \ } while (0) =20 -static inline int kstm_report(unsigned int total_tests, unsigned int faile= d_tests) +static inline int kstm_report(unsigned int total_tests, unsigned int faile= d_tests, + unsigned int skipped_tests) { - if (failed_tests =3D=3D 0) - pr_info("all %u tests passed\n", total_tests); - else + if (failed_tests =3D=3D 0) { + if (skipped_tests) { + pr_info("skipped %u tests\n", skipped_tests); + pr_info("remaining %u tests passed\n", total_tests); + } else + pr_info("all %u tests passed\n", total_tests); + } else pr_warn("failed %u out of %u tests\n", failed_tests, total_tests); =20 return failed_tests ? -EINVAL : 0; @@ -36,7 +42,7 @@ static int __init __module##_init(void) \ { \ pr_info("loaded.\n"); \ selftest(); \ - return kstm_report(total_tests, failed_tests); \ + return kstm_report(total_tests, failed_tests, skipped_tests); \ } \ static void __exit __module##_exit(void) \ { \ --=20 2.25.1