Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4376927ioa; Wed, 27 Apr 2022 02:23:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBMObHrVc26DC06nKNeGBqkX/9RZbKZJEAX9yYF/SVp4KmzHgnXOoBZPejmizV23oPLBiN X-Received: by 2002:a17:902:ed82:b0:158:fef8:b501 with SMTP id e2-20020a170902ed8200b00158fef8b501mr27171898plj.47.1651051403796; Wed, 27 Apr 2022 02:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651051403; cv=none; d=google.com; s=arc-20160816; b=d0KG3X1hX/zsFPnC0Ak1RUWJRP7WlABDxQTGUCTIFw6olWcRSN84UXfH8hFXj9HPYb S5Vj2mCklt/wqiAURh4sK7hMVLF6p3Zxi1uy3GmE6WVlzQ1bcOWzGmjPpuT0w7wa+nLt z+EI9dQ4ZfX5DLWNcyHzHlX6m0mE5k85PlHtd3CYZrZZ1Fj7/6IVA+LL8TuJFNriTtFM fWL8kKfbcosqAhSGGOCMDPy9xg4S6lCSiMiC1Ja8m+lySYfja3b6OPoO+AoTx6hPvEqz fkWAAHpSJMi56Jzt5fhO1JMY9k2qo8p/HcBVmHPOQAQ8BTxxoEL8aAM6jLiV2LN14Pj6 sW5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5pUdY4DuhndvUjRCdZpuhyNHEEZPCX6wjZH7Y0BBjOs=; b=lnRrEKr8rdKWzJePTqkVg4mM4KvqHdA/N4ZXUAWxiJap7OMKMEso13+c7dgKvJs6p1 ZX4fOkLW4cVhyAB0sdmr8SLwi91IBNj8Fp6iUI7cBiI0xEbYz7RHjNiKP/Wq//Zl/Okh 25UoRwWkx+dhziY3jVpnnDGwv58WNyGcGrepTMj1J6TP85h7slp0dqB+9ANfK7tAHSRe GH44AVtJBselB+2/iVmrGoY3x7O097fjOSiKOOn9bTrEBA8lRnpi8zrUcaXQFyLKYkzJ sncEDUfbNDTPKJ+eFnBNKeFDHNDgbVOx2AcqT/rSFQ4eyaQN4A9/8KZywtRMbyeg5dWF yRTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MMzKYlNT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u16-20020a170903125000b0015d1ad56d59si1181240plh.317.2022.04.27.02.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:23:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MMzKYlNT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B0EDA245450; Wed, 27 Apr 2022 02:09:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357369AbiD0DK3 (ORCPT + 99 others); Tue, 26 Apr 2022 23:10:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357362AbiD0DJ6 (ORCPT ); Tue, 26 Apr 2022 23:09:58 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFEBD35DC8 for ; Tue, 26 Apr 2022 20:06:48 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id j6so693997ejc.13 for ; Tue, 26 Apr 2022 20:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5pUdY4DuhndvUjRCdZpuhyNHEEZPCX6wjZH7Y0BBjOs=; b=MMzKYlNTUYW6BDIRK8K13taSCkVye8khVNBJGeE9UsfetHvXRw2ROzem+96mVFCZN7 b5LWUcoeCd2yM+yq0dJb7zMfvK/wlsIYSeqnQiW1y15LcVd63/goFL/WOf2OEG5cB+pm 86JnyL1PFwTSMhYQb6rr1aM5oR3HtVSNMcCGzwYjMCZco3bBKcdHaF6eQF0tY8s2FUO9 epSGkQoT9TnG4+Gf941Qyc30HgUsrhaIc57yj+57cadLLUTIt0lcNubLzaXPzL0/cd9Y bISfSkPCVFFgnYCyTqZgOrgYJUFPkSet1WHiONHpCa8oMzeuV3ey1PWpoU7eLvjkrg6d A1Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5pUdY4DuhndvUjRCdZpuhyNHEEZPCX6wjZH7Y0BBjOs=; b=1pn3dVIEjK3w3ElkTSS189a3VgXZLiZaoP0A9C42PHypSGc1xnF4mHoaoyFFUjMUXf FrGp7uKPuqNbpsLODkDHUN2/JVdVY61io2/XqYxx3czYNccupINhXx/KQElsH4te6lkW 4NDI2zQMy6NANpVerMMspnCQ4QVMMjfsQV42p9orEsxexTm4R9PNlAwDe4tyRT0AfQvR k/QKsk96sqOY7+1Spd+Qi9NeVWUaBbzuZxpz/7zj+3/e8c5pKvEiUXNUYWFH5cNz7jnH oiLMMcNGSx6GehIsRaHbD5FJAWx2iKN9ItEHz756W2FtP9/HnKzgAtIXOKsGqDKu0CXk bx5A== X-Gm-Message-State: AOAM532Qh8GDKIYpnS6YHfyL2wMSdiVu3zHRNgAZvp9JIhV1i6CdSP05 AhR8JrPIdLvxWVYqcjpTMPVL1QjJ69qLcv0SzNLkzc9qbII= X-Received: by 2002:a17:906:314e:b0:6f0:659:963 with SMTP id e14-20020a170906314e00b006f006590963mr24850096eje.358.1651028807135; Tue, 26 Apr 2022 20:06:47 -0700 (PDT) MIME-Version: 1.0 References: <20220426181925.3940286-1-dlatypov@google.com> <20220426181925.3940286-2-dlatypov@google.com> In-Reply-To: From: Daniel Latypov Date: Tue, 26 Apr 2022 22:06:35 -0500 Message-ID: Subject: Re: [PATCH 2/3] kunit: add ability to specify suite-level init and exit functions To: David Gow Cc: Brendan Higgins , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,USER_IN_DEF_DKIM_WL autolearn=no 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, Apr 26, 2022 at 8:56 PM David Gow wrote: > > > > static size_t kunit_suite_counter = 1; > > > > -static void kunit_print_suite_end(struct kunit_suite *suite) > > +static void kunit_print_suite_end(struct kunit_suite *suite, int init_err) > > A part of me feels that it'd be nicer to have the init_err be part of > struct kunit_suite, and have kunit_suite_has_succeeded() take it into > account. It could go either way, though -- WDYT? Yeah, passing it around as a parameter felt a bit icky. But I think adding it in as a field feels worse. Another thought: perhaps have this function take a `kunit_status` parameter instead? Moving the ?: expression below out into the caller isn't that bad, imo. > > > > { > > + enum kunit_status status = > > + init_err ? KUNIT_FAILURE : kunit_suite_has_succeeded(suite); > > +