Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6196480rwb; Tue, 22 Nov 2022 09:59:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf5y/HavkeC9KXalGi6Ir9Ut+TiuWPFpguM0BW9Wp0wls50ai1GFkXRXbCxOgLOxvaoEiI3G X-Received: by 2002:a05:6a00:2c87:b0:562:e790:dfe0 with SMTP id ef7-20020a056a002c8700b00562e790dfe0mr26313660pfb.16.1669139961035; Tue, 22 Nov 2022 09:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669139961; cv=none; d=google.com; s=arc-20160816; b=yawUVMQZfYZ3+AfgHXbICTg+KRbf6wGYQE5fRiZvaZFtbdHzf2D/pMVdwiFE49C5/J T5sEnxIzmboXQI2TYmyvxjFeoxAwi6XBm4X0cf+BxSj3Ls2feq9wQFfAFNowGnW+AJDf 0tEbEog3T+YBaSwTH5vMumEfS5YED6Yn+DMypnQX5ExJ0SjJ2H49PepfL7tn00lOec8w XxYUVRpy2gWNZQsZ92B2DDNzv0cRWC+J+QPs2KkBceBK4241RcFsLu/JH74/7OPZLr4B 5GD1BQx2OUKOHxWTZIApqHNkUK9rCVT68FUeehDuTllXtDaxZAeceiWW5fbo/K4ow/k/ Tvfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Trw6pRag45zh7xbBzKuk9eUIAumLjV1FB/I5WWUMeXc=; b=MyiYbW+u/E8VttMsBHfyXyd+0Tn4IJ9ljuFddpJWHcrxJywH7wnDcEO93X31xaLbdJ HccdxcWNqYZjhOvviLJNusqR2l44amEs4tZ+j9qlcN7WEYTH5Xnw3QY7C43imlOYZgsk TzUwBSlzXssMhHlO5Y75rrl6LfONfEHdbANZYDx5Vyl0B5Ftq8tln3QnlZbl3mh4OSJE IUkJeZFkAAOnwKbHSIDEypHoFq378gY3lm3NgS1ca7YIyxWKbKxtkLOs0jC35fqWdYQL s7iiirreL5kmkP3nro0QShsUzArj4lKn48cYoI7Mas8ilXA+zeS8qO7G3MhyASkMZR/R 1UkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AJOsT7QL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a193-20020a6390ca000000b0043c00d4d5a3si14203545pge.93.2022.11.22.09.59.09; Tue, 22 Nov 2022 09:59:21 -0800 (PST) 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=@google.com header.s=20210112 header.b=AJOsT7QL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234278AbiKVRO5 (ORCPT + 91 others); Tue, 22 Nov 2022 12:14:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232889AbiKVROz (ORCPT ); Tue, 22 Nov 2022 12:14:55 -0500 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEBE9729B6 for ; Tue, 22 Nov 2022 09:14:54 -0800 (PST) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-3a3961f8659so59114007b3.2 for ; Tue, 22 Nov 2022 09:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Trw6pRag45zh7xbBzKuk9eUIAumLjV1FB/I5WWUMeXc=; b=AJOsT7QLtuXDOuqy8Nd0IGY7ZchJBpJoPvWh9Vj61PSLn6YqfZr843CbYEjqCXumYy dLBBDwqSL0uccXO8vUb4PtIE2gttVA6O8zx5TTZ9r5LikYoQkKw1la+JO08szC3HK4Yy yFdEUjvlTsyRoNvmp5qFe8kHanUkkAh70rHNjqUaAxmzWHD+89FucUS22ae6nfITrfr6 txyfXpjPfdRBwebcTlBBIFyVRQX5VyCw18U9e5nb45jhFYFgljqjpSQHAi6JtUDKlHSJ zU+gIisrqVQ9gVvfPpgdRcwB9vQ9W54orXzvWCm+XK1pw3HC+Qy4GDzWfY9RMX3V2sxg 0+5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Trw6pRag45zh7xbBzKuk9eUIAumLjV1FB/I5WWUMeXc=; b=8Bc26jl2uqcX+5euKs+IvH1TifqkvOcxDIn6iAVHZILKfkIhagL1mg0Yy08iU7CA8T NERvk6J/8Jx+ZM54vZDLckbfR/dQc5uO0YLPU0tyRQtfxtxhywIGYtG6E1vuxkPYkI63 CwQDdu1QCKFEK6rD5qkihVthVOZ8nQtZARtZ0k4yuiEFsDN6vxZIByNSHXLmsyGhMHCd C3jNyP8cWD26IqYFaPr8XO6qZovpdyx0FqozBFgHDs7A3bwTPCbs4RQfPMfGTPC2uXN2 g/cARxDgQ7ELZGtDBMJNL9JKnO44fRImIWjhROiazh8rRrbIOgGVzy2d0LstihT6vdMk Y24w== X-Gm-Message-State: ANoB5pmP5p8l8eT2MY0EkP+Mx3CpEMzYHJRxd2+/p7iQhOIjM5k6zfQF bnOWVfp2Rv4sUG01Ggm4qmwS/cnGR/FkLuNyZTA5pA== X-Received: by 2002:a0d:dc05:0:b0:36a:bc93:587c with SMTP id f5-20020a0ddc05000000b0036abc93587cmr23162179ywe.59.1669137293721; Tue, 22 Nov 2022 09:14:53 -0800 (PST) MIME-Version: 1.0 References: <20221121184743.1123556-1-rmoar@google.com> <20221121184743.1123556-2-rmoar@google.com> In-Reply-To: From: Daniel Latypov Date: Tue, 22 Nov 2022 09:14:42 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] kunit: improve KTAP compliance of KUnit test output To: Anders Roxell Cc: Rae Moar , brendanhiggins@google.com, davidgow@google.com, skhan@linuxfoundation.org, mauro.chehab@linux.intel.com, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, isabbasso@riseup.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Tue, Nov 22, 2022 at 1:17 AM Anders Roxell wr= ote: > > On Mon, 21 Nov 2022 at 19:48, Rae Moar wrote: > > > > Change KUnit test output to better comply with KTAP v1 specifications > > found here: https://kernel.org/doc/html/latest/dev-tools/ktap.html. > > 1) Use "KTAP version 1" instead of "TAP version 14" as test output head= er > > 2) Remove '-' between test number and test name on test result lines > > 2) Add KTAP version lines to each subtest header as well > > > > Note that the new KUnit output still includes the =E2=80=9C# Subtest=E2= =80=9D line now > > located after the KTAP version line. This does not completely match the > > KTAP v1 spec but since it is classified as a diagnostic line, it is not > > expected to be disruptive or break any existing parsers. This > > =E2=80=9C# Subtest=E2=80=9D line comes from the TAP 14 spec > > (https://testanything.org/tap-version-14-specification.html) > > and it is used to define the test name before the results. > > > > Original output: > > > > TAP version 14 > > 1..1 > > # Subtest: kunit-test-suite > > 1..3 > > ok 1 - kunit_test_1 > > ok 2 - kunit_test_2 > > ok 3 - kunit_test_3 > > # kunit-test-suite: pass:3 fail:0 skip:0 total:3 > > # Totals: pass:3 fail:0 skip:0 total:3 > > ok 1 - kunit-test-suite > > > > New output: > > > > KTAP version 1 > > 1..1 > > KTAP version 1 > > # Subtest: kunit-test-suite > > 1..3 > > ok 1 kunit_test_1 > > ok 2 kunit_test_2 > > ok 3 kunit_test_3 > > # kunit-test-suite: pass:3 fail:0 skip:0 total:3 > > # Totals: pass:3 fail:0 skip:0 total:3 > > ok 1 kunit-test-suite > > > > Signed-off-by: Rae Moar > > Reviewed-by: Daniel Latypov > > Reviewed-by: David Gow > > I tried this patch, see the full boot log [1] and I can still see some > tests that output the "old" format with 'ok 1 - kunit_test_1', for examp= le > > ok 1 - 1901-12-13 Lower bound of 32bit < 0 timestamp, no extra bits > > Isn't this something that should be converted too? Yes, thanks for catching that. That's what I get from only looking over the diff this time since I thought I remembered the code... We also want this diff to fix a) debugfs, b) subtests. diff --git a/lib/kunit/debugfs.c b/lib/kunit/debugfs.c index 1048ef1b8d6e..de0ee2e03ed6 100644 --- a/lib/kunit/debugfs.c +++ b/lib/kunit/debugfs.c @@ -63,7 +63,7 @@ static int debugfs_print_results(struct seq_file *seq, void *v) kunit_suite_for_each_test_case(suite, test_case) debugfs_print_result(seq, suite, test_case); - seq_printf(seq, "%s %d - %s\n", + seq_printf(seq, "%s %d %s\n", kunit_status_to_ok_not_ok(success), 1, suite->name); return 0; } diff --git a/lib/kunit/test.c b/lib/kunit/test.c index 19344cb501c5..c9d57a1d9524 100644 --- a/lib/kunit/test.c +++ b/lib/kunit/test.c @@ -556,7 +556,7 @@ int kunit_run_tests(struct kunit_suite *suite) kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT - "%s %d - %s", + "%s %d %s", kunit_status_to_ok_not_ok(test.status), test.param_index + 1, param_desc)= ; Daniel