Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5676286rwb; Tue, 1 Aug 2023 06:29:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlFO1i5RUDdCm/yLZN9eV5NevEIb/zsZtDwVAapynqU1jrpM7QcZBgmXjoEpy66HPiP82Vqo X-Received: by 2002:a05:6a20:6a23:b0:135:110c:c6e1 with SMTP id p35-20020a056a206a2300b00135110cc6e1mr14729223pzk.7.1690896563727; Tue, 01 Aug 2023 06:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690896563; cv=none; d=google.com; s=arc-20160816; b=kidRXp2bFKIBhrI2mxZmYRawuYyLMnofJ5Z89e8nvbNf9ADxbko5ezf1ldj6sQA1zd huAUl7qmlPFjvVmRln2oOza8MJnOnfQlbE9iyjvUUk4wO797EcPZ9kEV6zFcDdbWk23g LRYHC1B3QEFjWH+ef2YCsKyN3IvkSzFAE0z7KL3PIEsbvDQMizA5YewcBUHZAc5UTBr5 lGq66yCti4GAo0UsQjZ3uOu6u+iRiW9KZhg911eDIMZOb2ay9aosuHpRR4+Je9JfQ+10 fGdlriaRYt9k5VDrUZSfcAuondeB1xFlfe6IGUBEVi+cihwo7V0IqkQEc1/zjK8j0rbK FNQw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=v4Oe3ccq5b4XJlQWATvHE1FkrQziHzfcX/lfVQ2J7jI=; fh=jNrrHkx6pEAGcGvo7Z4h8nNisC4uLl/PfmektR0SF/E=; b=X2+/DBN5LzdNzHxj8o/8aAsgrUGU+AGJeEGOKn/bU0qiQttqO4V1qhCptpA7LXwE/C ySN+rxWDJW05kP/OQTGmpxCyc0HK7TGUHTg3i/EpdLgZCpq7sQ7hTDgRBrCwyQmSLJu7 qOeHBm+SINnvt8Q/k1PFl3pTrHT52h6Hor+t1RqZf83svlWwuaYQtxDquQuiZVZi43BW QwmE2KN9G3h57G6KvBGsjSHCZzpLbWTlNCdKo3M/L6nOFgZQcDYeVUwzHW0/PWinL+T+ bwsER/lLkSeZdkE6FDri+xkVEZOEqZrInD70ggRbJvilKOiiwjFyFgzEhOeH9yX387ya IBQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NscodObE; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a6542c3000000b005579d6bdf7esi6838876pgp.856.2023.08.01.06.29.10; Tue, 01 Aug 2023 06:29:23 -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=@kernel.org header.s=k20201202 header.b=NscodObE; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233986AbjHANRV (ORCPT + 99 others); Tue, 1 Aug 2023 09:17:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232541AbjHANRU (ORCPT ); Tue, 1 Aug 2023 09:17:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE0AA10E; Tue, 1 Aug 2023 06:17:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 52A1F615A0; Tue, 1 Aug 2023 13:17:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDB9EC433CD; Tue, 1 Aug 2023 13:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690895837; bh=qXIRgH4mK+xtTO6grCOfqyhbajUmr7Zt70n3ttnq9n4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NscodObExuJ6qYr/qZV8BXmcaeXG9huOl7lIweoAgV95TST0F8UJVcvCvkUnyndym CikfBfqRw0A8ScDV7cPNhBLFnD5RSzdT9lebllSUoEYPJhOydWLPs7RWl008p2wU7S s139H2m1rIfRFDWgD47q4RuDCTYMShBiTiRCxFHC4LwCLYkIi7DLBCLyYzPRyJNFCl EcsFWAQQ5n3MxpX/+UX5RDp9QNglJIccXFESxZx10MzJ9nnHpXtIop9Jm2XBgzzdHM WZSGRGgIdgkvkhxxxdIZKDzx43pJC8/NczcR3FY9gIBib0oUJ8SI85XfDbw0GQR6+a toFQxKE1/YxYA== Date: Tue, 1 Aug 2023 15:17:11 +0200 From: Mauro Carvalho Chehab To: Janusz Krzysztofik Cc: Brendan Higgins , David Gow , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, igt-dev@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] kunit: Report the count of test suites in a module Message-ID: <20230801151711.2765e2eb@coco.lan> In-Reply-To: <20230731141021.2854827-6-janusz.krzysztofik@linux.intel.com> References: <20230731141021.2854827-5-janusz.krzysztofik@linux.intel.com> <20230731141021.2854827-6-janusz.krzysztofik@linux.intel.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 Em Mon, 31 Jul 2023 16:10:23 +0200 Janusz Krzysztofik escreveu: > According to KTAP specification[1], results should always start from a > header that provides a TAP protocol version, followed by a test plan with > a count of items to be executed. That pattern should be followed at each > nesting level. In the current implementation of the top-most, i.e., test > suite level, those rules apply only for test suites built into the kernel, > executed and reported on boot. Results submitted to dmesg from kunit test > modules loaded later are missing those top-level headers. > > As a consequence, if a kunit test module provides more than one test suite > then, without the top level test plan, external tools that are parsing > dmesg for kunit test output are not 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. > > Submit the top-level headers also from the kunit test module notifier > initialization callback. > > [1] https://docs.kernel.org/dev-tools/ktap.html# > > Signed-off-by: Janusz Krzysztofik > --- > lib/kunit/test.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/lib/kunit/test.c b/lib/kunit/test.c > index 84e4666555c94..a29ca1acc4d81 100644 > --- a/lib/kunit/test.c > +++ b/lib/kunit/test.c > @@ -729,6 +729,11 @@ EXPORT_SYMBOL_GPL(__kunit_test_suites_exit); > #ifdef CONFIG_MODULES > static void kunit_module_init(struct module *mod) > { > + if (mod->num_kunit_suites > 0) { > + pr_info("KTAP version 1\n"); > + pr_info("1..%d\n", mod->num_kunit_suites); > + } > + > __kunit_test_suites_init(mod->kunit_suites, mod->num_kunit_suites); > } IMO, the best would be instead to export kunit_exec_run_tests() and use it here too. Except for the nit, LGTM. Thanks, Mauro