Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3348005iob; Sun, 1 May 2022 14:35:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbn802+fuNhlNi5gLFrB4lFFz8nWmUDiy/OyjrUd8uzWw0M58fUDYPIUEFEY5zwsp0U+pl X-Received: by 2002:a17:902:8b83:b0:158:e061:4df2 with SMTP id ay3-20020a1709028b8300b00158e0614df2mr8804098plb.90.1651440904351; Sun, 01 May 2022 14:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651440904; cv=none; d=google.com; s=arc-20160816; b=Je8tsN8k0ZYqG8EjCeZ1VlaMtKWfXOUpOU8VhpRMGdvCdecC9cgNdSG3FArNIsMohD nZU+vWWqgDYMBrUtZMurBy063pKrWdXlmg/KSjtLOZX3TeshnXihuNPNYvcI4PNy1cCY 4PDPccp6PH/FuweoIkkuEo9g37dYj21tzM8YXBr45RuCyMRNJxINDKhTuEzvxNnPFqzl E3WAgaYSO5tlDD5mdQA7f85UsV8bRFo4xljfGDBP2i8J5wwek9deW7iKhxgahItnpfEl eQE9Qj+XCh5ln+TnrNmxvXOazDIdhTz1BAFMOBDDvtn3HajdPSWY5QB2dvoweuIQpSVL 6ZzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=2kiTLLWMzE1fRaVFv2RZTJ9b23xbStkawa5kRyjYyA8=; b=rAuxFW2pZoQ/34UOdpQwtyvxa46i6KquoqJw0Lqq8yBYI3aA3hmOtTl2cxAojIDwce HV/3bEZ5l28gSRcj914VAnplXXURzPgdwWpuarjhB9TynmvzQTlL4O5/LanKno/El9Uc 6XAdj4JfKV6q+a3aaB6efRgQNXFA7o/kNTRGu73AVzRU47ll3fJ4fNApuchds21mqN7f ohVYlyfc5qnR3wwYcHzUV89CE/DgaXlCzPp+uhaSWMOq7Vplyquyo85C/XkFgFTxW/l0 E4DovlxPkEFXVJ8bL8cgb49u8HajnnHu2gdl0ZIZk/kgDnhyT0R7M0HkBt8DpHqtv3CH 4pXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=keqK+zyl; 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 lr8-20020a17090b4b8800b001da2640f19asi13197479pjb.164.2022.05.01.14.34.29; Sun, 01 May 2022 14:35:04 -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=@google.com header.s=20210112 header.b=keqK+zyl; 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 S1379230AbiD2SQ1 (ORCPT + 99 others); Fri, 29 Apr 2022 14:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233327AbiD2SQ0 (ORCPT ); Fri, 29 Apr 2022 14:16:26 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89C9AA66C6 for ; Fri, 29 Apr 2022 11:13:07 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id i5-20020a258b05000000b006347131d40bso8010639ybl.17 for ; Fri, 29 Apr 2022 11:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=2kiTLLWMzE1fRaVFv2RZTJ9b23xbStkawa5kRyjYyA8=; b=keqK+zylXN4pY8llCOBPg1Er0xKEg1omQb4Cj4I7sP2jLPCAJxPCRtn2RdUNZGfWA2 FGOCY8T7aXIKF8uj4+c8dGhHnigGnxQu9g3akFu5WpTlvCwa0owfS9ei/ZrL6lUrF9pJ RLbPdQpht3OpwGjuhaMLs5UkOEAg7ZOnXSE6whUlBoUhl9PKXtjNdBJfDZia/A0YKEt4 sruyz8Uv6xOLeo4z/CO+19HT2Ld/0qcE92J+5JwquXW3cXxP7qguCR5+9qM8rO71vw6Q 9yGtVMTNpd6Y7h0MlWSEH1mJNIkJNicH2NJRugMUaQv79RX/Dhru8UyxOol5dieNeLd0 4XuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=2kiTLLWMzE1fRaVFv2RZTJ9b23xbStkawa5kRyjYyA8=; b=zcXlGC7R+Vvp8X6XlyGvAnZ5c+waXJE3kY22Brimihd+P8ndQ62Jix5QFBpGZ6yF5G pNP4DmfDwR9MtVkzMWJp4IP2OzJCn4ucLZPe6VD2XqpEdvOMDKijgDzwuD/suRKSCXpE QKFygW8ZnXB0bkuPwyZSFWBnkt34MGCsk/6OLkYne30jMXF+Qt9238Yt3pavxFDH41ql HJ3q83Bp/5Lv1viMMhufNs1Lp0csrWhXL4TnNvagCp3rJuaocrSGcnmEqxRnsBcsav+Y 0uYuv9d/2mZd9JUYRtuNGscnuLcmjEs0hZUfsSW722HgHGHV2Y9l86+vAednq5bnJstW pqsw== X-Gm-Message-State: AOAM533w0zksfCIWRq0gwf7OprHa4r7bSWgCX3YZYSqwat0xZ6YEt3Bz a0OGh5mvBvXaLWJjzAWrjeac2alvGdoHAQ== X-Received: from dlatypov.svl.corp.google.com ([2620:15c:2cd:202:183a:36d7:2dcb:1773]) (user=dlatypov job=sendgmr) by 2002:a25:d354:0:b0:645:d617:560a with SMTP id e81-20020a25d354000000b00645d617560amr682256ybf.247.1651255986725; Fri, 29 Apr 2022 11:13:06 -0700 (PDT) Date: Fri, 29 Apr 2022 11:12:56 -0700 Message-Id: <20220429181259.622060-1-dlatypov@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog Subject: [PATCH v2 1/4] kunit: rename print_subtest_{start,end} for clarity (s/subtest/suite) From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_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 These names sound more general than they are. The _end() function increments a `static int kunit_suite_counter`, so it can only safely be called on suites, aka top-level subtests. It would need to have a separate counter for each level of subtest to be generic enough. So rename it to make it clear it's only appropriate for suites. Signed-off-by: Daniel Latypov Reviewed-by: David Gow --- v1 -> v2: no change (see patch 2 and 4) --- lib/kunit/test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/kunit/test.c b/lib/kunit/test.c index 0f66c13d126e..64ee6a9d8003 100644 --- a/lib/kunit/test.c +++ b/lib/kunit/test.c @@ -134,7 +134,7 @@ size_t kunit_suite_num_test_cases(struct kunit_suite *suite) } EXPORT_SYMBOL_GPL(kunit_suite_num_test_cases); -static void kunit_print_subtest_start(struct kunit_suite *suite) +static void kunit_print_suite_start(struct kunit_suite *suite) { kunit_log(KERN_INFO, suite, KUNIT_SUBTEST_INDENT "# Subtest: %s", suite->name); @@ -192,7 +192,7 @@ EXPORT_SYMBOL_GPL(kunit_suite_has_succeeded); static size_t kunit_suite_counter = 1; -static void kunit_print_subtest_end(struct kunit_suite *suite) +static void kunit_print_suite_end(struct kunit_suite *suite) { kunit_print_ok_not_ok((void *)suite, false, kunit_suite_has_succeeded(suite), @@ -498,7 +498,7 @@ int kunit_run_tests(struct kunit_suite *suite) struct kunit_result_stats suite_stats = { 0 }; struct kunit_result_stats total_stats = { 0 }; - kunit_print_subtest_start(suite); + kunit_print_suite_start(suite); kunit_suite_for_each_test_case(suite, test_case) { struct kunit test = { .param_value = NULL, .param_index = 0 }; @@ -552,7 +552,7 @@ int kunit_run_tests(struct kunit_suite *suite) } kunit_print_suite_stats(suite, suite_stats, total_stats); - kunit_print_subtest_end(suite); + kunit_print_suite_end(suite); return 0; } base-commit: 59729170afcd4900e08997a482467ffda8d88c7f -- 2.36.0.464.gb9c8b46e94-goog