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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 9EC9AC433DB for ; Wed, 10 Feb 2021 05:18:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D21D64E28 for ; Wed, 10 Feb 2021 05:18:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D21D64E28 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C90736B0072; Wed, 10 Feb 2021 00:18:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C6A0F6B0073; Wed, 10 Feb 2021 00:18:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA44E6B0074; Wed, 10 Feb 2021 00:18:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id A4E3F6B0072 for ; Wed, 10 Feb 2021 00:18:32 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6E8D18248076 for ; Wed, 10 Feb 2021 05:18:32 +0000 (UTC) X-FDA: 77801202864.02.woman41_300b55d2760d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 5664E10097AA1 for ; Wed, 10 Feb 2021 05:18:32 +0000 (UTC) X-HE-Tag: woman41_300b55d2760d X-Filterd-Recvd-Size: 3860 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Feb 2021 05:18:31 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4B3CC64E58; Wed, 10 Feb 2021 05:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612934311; bh=I2BSPPWhLYHIwlo8vH0d0TDjqAzcfQC805BuqNnnmNk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RdnfOXxWqDbptZQoafXn1gqplM/yFJNUoo4mjtLH9hL+/cRMmXFhC86IB3Y0DkRMt SJ699QyB7va1oYHlq4T9nHCAQi1QorZ+alGpajITgJI57JlQwkGZuq6aLvDEMd2Xtr jdWetB9k66fob1XsAP5K5M4ERb9eLAindsbLJOAhce+Vt4Fi1lFRssv6P2fcmC0r75 z3ml1YqsSX3c+ghFEAoRyuRVKdFYOvzJsKKlLtKluWFC/n7cVzwSiXJ1LtO4BXzqcg 3BoiVZ6kV0QpXVD75YxzrglTyOMo3mIVDbk8XoUUuco4jassY5DKk16XGkkpi2aNgw hfaws0lzJpzBA== From: Timur Tabi To: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Vlastimil Babka , Andy Shevchenko , Matthew Wilcox , akpm@linux-foundation.org, Linus Torvalds , roman.fietze@magna.com, Kees Cook , John Ogness , akinobu.mita@gmail.com, glider@google.com, Andrey Konovalov , Marco Elver , Rasmus Villemoes , Pavel Machek , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/3] kselftest: add support for skipped tests Date: Tue, 9 Feb 2021 23:18:13 -0600 Message-Id: <20210210051814.845713-3-timur@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210210051814.845713-1-timur@kernel.org> References: <20210210051814.845713-1-timur@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/s= elftests/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 fai= led_tests) +static inline int kstm_report(unsigned int total_tests, unsigned int fai= led_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