Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2913641rwb; Mon, 7 Aug 2023 05:40:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJhFaaH0PC+EpsgAnK15ju0HKhTxowVTMIe4kvo4Fb7lSLFzaubv7hkL0xQZEGIeXXn7Hg X-Received: by 2002:a17:906:847b:b0:992:872:76d4 with SMTP id hx27-20020a170906847b00b00992087276d4mr8206722ejc.17.1691412009855; Mon, 07 Aug 2023 05:40:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691412009; cv=none; d=google.com; s=arc-20160816; b=XjH6nfw3hsQNb8xFY08unP6UVwYM0cp7Cgs8hGvSn1ihMgzoz8AzGwSi8m5iDJHZ0Z uS8q68Bs45ChpcCeyoepwevgjDI8NuUXSo3Kr7nilFGZJDyu/WO5VAkaLt0Drx/+QsbG jZ561IsfdY+Pm6OH3BM2zunZR8jDn8PnYJGnXWy+DpMzQTh6TAMOIDsNrZMwanbP2gIL YXA5/EChqqO1qVe6i7sAPM2QNmzY4i0bFRcXEA10yAIw10zwIOZ3DQ+yPmWK5tJQvKL6 rTr7jfbnlrR8cd8ynL9FjcCheCJFaYsmHvRbstsA06Hfs3rylP15XGQ2u+tcFiYdOGdP qjpQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a1709064ac900b0098d85fee2e2si4176079ejt.608.2023.08.07.05.39.44; Mon, 07 Aug 2023 05:40:09 -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 S231293AbjHGK2d (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 Content-Transfer-Encoding: 8bit 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 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 -- 2.41.0