From patchwork Mon Jul 31 14:10:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 12886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2085207vqg; Mon, 31 Jul 2023 08:19:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHgGtYPNalZRxKqbFCA3Jsf978wMiNhBJliBiXqDtA5x/LL4xfJaH+Qj/tEkZ73Gx55KAxs X-Received: by 2002:a17:90a:c7d1:b0:268:4485:c868 with SMTP id gf17-20020a17090ac7d100b002684485c868mr8283857pjb.49.1690816771998; Mon, 31 Jul 2023 08:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690816771; cv=none; d=google.com; s=arc-20160816; b=TFoyWBgFv1Q6LVfJS8eTpkrA8WAQXO8BD40413Hvl7VsZJ1pYfuEu69kN1R+uUWHtH 2IBhHaScNxsH3zgoC1ldA9+QIik8WNTT8kwr8TmLZFGlObZw+VDuMOOar0K4VY2m1yTH EVVdgrjJOP0qJPRdwLgxPGXW2WHuQJ8D0mOdsEXuyLRhx+KfImsGDWsgcUIByFtLgNC0 WMGrPIXB31GPCrxZJTHmW+f/cQm2a7UfafcsINLUqpLOqXOYlHqd/+LmBa3icM73V+jA Va9P5kaFm14bwlBIylGqFgC33u+VtMzP/XNI6FKYUOKGBuGCfUq6NjXjHXgfGY6A16/l iFmQ== 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=f/rCl/afWY1o7bGd+xkUcMPoyLhNC06xHhWkPFoy5GM=; fh=2DascdEigk5YKkI7xsPhzXnEwnq6+gHGf5jSQyJPeBg=; b=HMkEf4JKmLOmAA4gWuUBxa6eou+HcauuzanEI0yd27akqikz3DBP4PHUSnh+7hb/F8 V0/2UCxu2UX1l9b9uJi/aTnbek/gWxRLrDLV999YLDrEibs6rCptwZ6jR5pKLSPPR04c 4+ByYpnCK0rt/PyUE+Uz16a3rKAIGqHUx39lt2icoP+gfmqwXAda/k/1XEcaiU/ynYpg coOIy9kJsxchpD/jw3BImJqjY2ds26OBYcNEElDBciBnz6kWUwdQy31pezPIeJIAs5v/ bFZHOhPNpx94ney8PUo5Jh2pChfwz48JHyT/4TVCAwoXldeeHOz2W2dxtxGcK5mQjbOU 8n2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iFOLej+3; 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 w1-20020a17090a8a0100b00262f8c7ed18si8969513pjn.94.2023.07.31.08.19.19; Mon, 31 Jul 2023 08:19:31 -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=iFOLej+3; 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 S231623AbjGaOMu (ORCPT + 99 others); Mon, 31 Jul 2023 10:12:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231731AbjGaOMq (ORCPT ); Mon, 31 Jul 2023 10:12:46 -0400 Received: from mgamail.intel.com (unknown [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96CEBB3; Mon, 31 Jul 2023 07:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690812761; x=1722348761; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=8lJQW7XtYIZJGUpSg5bDxxZ5nMixXPpf80t0cGGyY2I=; b=iFOLej+3Gi4EcqvZla2V8O8GivIhFXW062mjL1Hz1WPAJOK6oObhtYud f9eNwqfzO7IgKYKcUEHPoswLNY0DiptA0aCMDFLP2QtDxAkcTxJldOKVc CLLoBS6KqYFSOO/I8UZYa6jtBmJDTvuMlofollJbRaykBY0Gng8ZWaoGp GgKK8zTvKDSrSWS+EUVQQPw6ql/45P7OnGorOsI1+XL5MCwpXNb7QlTW6 K/EDd9sRAAlpM7v/VOTY5vs977qrKXB6NIkuc2T5I2GJvYUijvnHZlhFV JJF59oIS2ngeU+pGmjy3HhNZGDNETbys/ZRnFHi7gqDhSAjI5+LCgpv6Y Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="455403611" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="455403611" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 07:12:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="728324343" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="728324343" Received: from jkrzyszt-mobl2.ger.corp.intel.com (HELO jkrzyszt-mobl2.intranet) ([10.213.1.128]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 07:12:38 -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, Janusz Krzysztofik Subject: [PATCH v3 0/3] kunit: Expose some built-in features to modules Date: Mon, 31 Jul 2023 16:10:22 +0200 Message-ID: <20230731141021.2854827-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,T_SCC_BODY_TEXT_LINE 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: 1772917825816549032 X-GMAIL-MSGID: 1772949887175395578 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. v3: Fix CONFIG_GLOB, required by filtering fuctions, not selected when building as a module. v2: Fix new name of a structure moved to kunit namespace not updated across all uses. 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 | 14 +++++++++++ lib/kunit/Kconfig | 2 +- lib/kunit/executor.c | 57 +++++++++++++++++++++++++------------------- lib/kunit/test.c | 57 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 104 insertions(+), 26 deletions(-)