Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3270973imu; Thu, 29 Nov 2018 19:30:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/UFZIu8HKPteTqQkjTL7MALO/MbmyDwjnoDjD4WMXBByx/jbfiaNYV3NBQFRrdR++sKFcvW X-Received: by 2002:a63:c24c:: with SMTP id l12mr3503595pgg.146.1543548607797; Thu, 29 Nov 2018 19:30:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543548607; cv=none; d=google.com; s=arc-20160816; b=HpZvG+SgrF/zCJ72lSRgDNt5E0iqc98heGeOpg0yej8HUWkEEjyFsx1IIHROoz60mu YDgS5WWGU55Gu8MLeFnboHlPO3o6I/SbVXDKEUmsuHTnoa+qApynp7t1VzFxCQYMXdSi N0KSRuj+YpX955vbDuC+opWldjIw+fBy8vtTBgtWI4+VJaVpRugr5jbvydkxGsKAcFK5 tihWQUw7ou7HepB6RJOtyGhyfRN44/T5PWEmKPJWZN0Lhv8q36aPCrQ77TqbUkQSS7CF hUXY9fHgNWHyBxrTuh4XCE9+zqdUUpDJe3lcknaEaBq0Xm9V5CAp6MLCKeygWSBNxFuX hvLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2SGDMtSnDzawD8L/WpsqYzbqbEIipLqFW4fipDJqSdc=; b=wYUvSamRuN+m61v6JRSiCTS+vWSOUXpE0akIcpKHyogk7I2iHTMKGJdT9ilH+oyZRK nn9BzDOCDfKb1s2A2G5cxxfO58e6OJlmKIiDgj+cvQxtHVq7SCCydK/SnE4rESd8Syei 7hF2z6ueiwyDl534/i2lj11jAWKfogq0UXuWCL3juzPiiAYdlj1X0F4XoEk5FGlxJ/Uu Q6DtMmJWoAFtOFzZ2vX5BDMyFBEJv9mX2qm1C/7OVagAS0g9dzvVd2m/TIDXlpQck0mP j1wceqnW79+sjPMD8Td3YQyZYNaU9RU7YmOYNnTFjkd5A17h49xZ6wGychP7Z3vg/4p3 3zOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si3742409pgn.32.2018.11.29.19.29.52; Thu, 29 Nov 2018 19:30:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726527AbeK3Of4 (ORCPT + 99 others); Fri, 30 Nov 2018 09:35:56 -0500 Received: from mail-pf1-f177.google.com ([209.85.210.177]:35411 "EHLO mail-pf1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726161AbeK3Of4 (ORCPT ); Fri, 30 Nov 2018 09:35:56 -0500 Received: by mail-pf1-f177.google.com with SMTP id z9so2087106pfi.2; Thu, 29 Nov 2018 19:28:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2SGDMtSnDzawD8L/WpsqYzbqbEIipLqFW4fipDJqSdc=; b=IKwtiXp1pD+C0Vk3s2YQz8WVkx8YSYATGUNwP3Ek6vpDuxRLSYFby44NxgvPAX3oe3 wz3xEPpN8iBqcVoto2OPDCNJOSR8C0LLi9k6lfeWVEjJvi/O40Ni69xccGlM2HxO1gFo gn3KEVxlccbT0ryvlx8eVw0alzBceGyCiS7MPUwHLxtLFrrqjfs2ln5YujzSZRduaIZu i6nIMgTvsDWt2eizgj/bc9pc1hhZ3hA3EPHOUjadwV9yWbS3YSB49xlgth4z5T8JYC0B 1t84cOuA+yi4BImd7padhEcPiVbqKx+oFRixigcY7okk8dmaeY199ibN3f67aomT9VRr 86pA== X-Gm-Message-State: AA+aEWaVYNpMMSdj/6XXIFetUskwaP5bE+lvjF/1ReT4gYEroP7bSphT yOUw7T62/1ZGvHwNQ/FpiRA= X-Received: by 2002:a63:2586:: with SMTP id l128mr3543015pgl.104.1543548486406; Thu, 29 Nov 2018 19:28:06 -0800 (PST) Received: from garbanzo.do-not-panic.com (c-73-71-40-85.hsd1.ca.comcast.net. [73.71.40.85]) by smtp.gmail.com with ESMTPSA id i193sm4291427pgc.22.2018.11.29.19.28.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Nov 2018 19:28:05 -0800 (PST) Received: by garbanzo.do-not-panic.com (sSMTP sendmail emulation); Thu, 29 Nov 2018 19:28:02 -0800 Date: Thu, 29 Nov 2018 19:28:02 -0800 From: Luis Chamberlain To: Brendan Higgins Cc: gregkh@linuxfoundation.org, keescook@google.com, shuah@kernel.org, joel@jms.id.au, mpe@ellerman.id.au, joe@perches.com, brakmo@fb.com, rostedt@goodmis.org, Tim.Bird@sony.com, khilman@baylibre.com, julia.lawall@lip6.fr, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, jdike@addtoit.com, richard@nod.at, linux-um@lists.infradead.org, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, robh@kernel.org, dan.j.williams@intel.com, linux-nvdimm@lists.01.org, kieran.bingham@ideasonboard.com, frowand.list@gmail.com, knut.omang@oracle.com Subject: Re: [RFC v3 01/19] kunit: test: add KUnit test runner core Message-ID: <20181130032802.GG18410@garbanzo.do-not-panic.com> References: <20181128193636.254378-1-brendanhiggins@google.com> <20181128193636.254378-2-brendanhiggins@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181128193636.254378-2-brendanhiggins@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static void kunit_run_case_internal(struct kunit *test, > + struct kunit_module *module, > + struct kunit_case *test_case) > +{ > + int ret; > + > + if (module->init) { > + ret = module->init(test); > + if (ret) { > + kunit_err(test, "failed to initialize: %d", ret); > + kunit_set_success(test, false); > + return; > + } > + } > + > + test_case->run_case(test); > +} <-- snip --> > +static bool kunit_run_case(struct kunit *test, > + struct kunit_module *module, > + struct kunit_case *test_case) > +{ > + kunit_set_success(test, true); > + > + kunit_run_case_internal(test, module, test_case); > + kunit_run_case_cleanup(test, module, test_case); > + > + return kunit_get_success(test); > +} So we are running the module->init() for each test case... is that correct? Shouldn't the init run once? Also, typically init calls are pegged with __init so we free them later. You seem to have skipped the init annotations. Why? Luis