From patchwork Mon Aug 7 10:23:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 13227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1371249vqr; Mon, 7 Aug 2023 04:11:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHI9NGwZHDjMo4sx/Ln7TGwZd5h4wraTMrUzWl8iII473RShPEgLcXfE7WVXYGH+Wi2fxJ4 X-Received: by 2002:a05:6a20:6a1c:b0:13e:1712:4c01 with SMTP id p28-20020a056a206a1c00b0013e17124c01mr9676196pzk.42.1691406702678; Mon, 07 Aug 2023 04:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691406702; cv=none; d=google.com; s=arc-20160816; b=YeAfxu1/acQ+afixsPVRlvS85Vnqxxpo91/eXgiqr2TwWcHWgTd3BYp9iRFPMTjzJK GJY+Wpb7qq8btHutQa3Eho8VS0+LK0YDfw8Izq5zc2pDVqyk4lwxuQlyRPTHKcHOD8BS zCLW/fKkgneLqYFgULU7nkyNN/cD0Tg0HLK274xS52+KTddf7pCbttPGCnny0NyTWWp6 YmMFy2eIy9+0ATwyyoHK1uSfc/7wyvAy8P+HUT7J4QuUlDrlTenLf+Dcn668h6jDDVL8 A+OWJlIIr5YuaSiCOl9Sw1EBlEeeQxiJkMJ6FZ12dNdxRTePWa1aRN4MIRmH0ch5lVMg pVIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=t9SZK7GUk0llHLxwF4JGCBkXsm6H8qQIVlpXuMUPd/0=; fh=lK2waLL/9kOOSPYhHXVFA/ASjnnvCMfcH9+nf0X7mD4=; b=ppzIs+1u8cZEDXfxmt2Sfoqhw1HvpClrzuiMfaODLW7y73NduTJqcyolULOVfo2Chp OMZZTEHDglJDjQ6lhzqLrgOp+IC2VGB4vzMmUeFtQ/4j3RLSXKpD8RsiExbXemQZBsMT 62REPeWDitxrBFO0wbCWEpUfzrrOT8XxDSFZZEL1KyfQyKmIQ6Fpxwbn+OX3njI+FJvu Wb/xGql95yt70faceQKPrs4CvPxeWeRqgWfbhs74qeKd/wb5AavWMcsIPdRsYBrMFL6q gNGOmbeUzjaFBjUjPxLfbnDup3NUXxlVnzBcAiL5OvAzPlM/Itnl3eJVBxlZYO08aGCe pCOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KB1HzHMV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i23-20020aa78d97000000b006768627bc5asi5337220pfr.199.2023.08.07.04.11.21; Mon, 07 Aug 2023 04:11:42 -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=@intel.com header.s=Intel header.b=KB1HzHMV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231297AbjHGK2d (ORCPT + 99 others); Mon, 7 Aug 2023 06:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbjHGK2b (ORCPT ); Mon, 7 Aug 2023 06:28:31 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B764210F4; Mon, 7 Aug 2023 03:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691404110; x=1722940110; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dkHorrBffv4xQS+bxgJDmsQVKSSR++utvuao/xqLQqw=; b=KB1HzHMVJ2OXbCG6iF/Grlc4tFUzzG1raPQhzd1EFQCKWveyHmYbJyI2 ghTrYZvpN+BfHiXh3eBf3S6QSKjagXccSIadCMOmH9K3hFd/+CKTzhWI+ 46aqABLXPXHLNnCv2VFo/C53gOqHbOX0vR150jhbR9hKJqoxAXtdeTYgI 1FznqpPmQp3WXsWMy9poUIcro3u5fKRUWjP/wmFVAxZjvHCry07/NqZcN LqFFnXkDHPLVWwu4pFh6Y3ca6oba1GsAsygkzXqqKTKy4OSHQCQqsHrgU HI5YTSNMayzwhXOiCz6ta6KdvwP/u+zHKq2vSSb/Vg15HJjhA7xUjdxJE w==; X-IronPort-AV: E=McAfee;i="6600,9927,10794"; a="350818181" X-IronPort-AV: E=Sophos;i="6.01,261,1684825200"; d="scan'208";a="350818181" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 03:28:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10794"; a="730909195" X-IronPort-AV: E=Sophos;i="6.01,261,1684825200"; d="scan'208";a="730909195" Received: from kornelo-mobl2.ger.corp.intel.com (HELO jkrzyszt-mobl2.ger.corp.intel.com) ([10.213.30.73]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 03:28:22 -0700 From: Janusz Krzysztofik To: Brendan Higgins , David Gow Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Mauro Carvalho Chehab , igt-dev@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rae Moar , Janusz Krzysztofik Subject: [PATCH v5 0/3] kunit: Expose some built-in features to modules Date: Mon, 7 Aug 2023 12:23:53 +0200 Message-ID: <20230807102352.4607-5-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773568474728974144 X-GMAIL-MSGID: 1773568474728974144 Submit the top-level headers also from the kunit test module notifier initialization callback, so external tools that are parsing dmesg for kunit test output are able to tell how many test suites should be expected and whether to continue parsing after complete output from the first test suite is collected. Extend kunit module notifier initialization callback with a processing path for only listing the tests provided by a module if the kunit action parameter is set to "list", so external tools can obtain a list of test cases to be executed in advance and can make a better job on assigning kernel messages interleaved with kunit output to specific tests. Use test filtering functions in kunit module notifier callback functions, so external tools are able to execute individual test cases from kunit test modules in order to still better isolate their potential impact on kernel messages that appear interleaved with output from other tests. v5: Fix new name of a structure moved to kunit namespace not updated in executor_test functions (lkp@intel.com), - refresh on tpp of attributes filtering fix. v4: Use kunit_exec_run_tests() (Mauro, Rae), but prevent it from emitting the headers when called on load of non-test modules, - don't use a different list format, use kunit_exec_list_tests() (Rae), - refresh on top of newly introduced attributes patches, handle newly introduced kunit.action=list_attr case (Rae). v3: Fix CONFIG_GLOB, required by filtering functions, not selected when building as a module (lkp@intel.com). v2: Fix new name of a structure moved to kunit namespace not updated across all uses (lkp@intel.com). Janusz Krzysztofik (3): kunit: Report the count of test suites in a module kunit: Make 'list' action available to kunit test modules kunit: Allow kunit test modules to use test filtering include/kunit/test.h | 21 +++++++ lib/kunit/Kconfig | 2 +- lib/kunit/executor.c | 115 ++++++++++++++++++++++---------------- lib/kunit/executor_test.c | 36 ++++++++---- lib/kunit/test.c | 37 +++++++++++- 5 files changed, 149 insertions(+), 62 deletions(-) base-commit: 1c9fd080dffe5e5ad763527fbc2aa3f6f8c653e9