Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp146420ybi; Tue, 2 Jul 2019 17:59:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEJu2YDYhwza/bkCiEXov2uIIFb8Wjuu+7WA65qffy/fsb/m+FGU62Ob4kdt1HsMlarcca X-Received: by 2002:a63:6986:: with SMTP id e128mr34996104pgc.220.1562115554273; Tue, 02 Jul 2019 17:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562115554; cv=none; d=google.com; s=arc-20160816; b=TTT2Zprz7dELTkXgJWvB/qVdpIRvQyQMgWvLNV3ZBS6cVzBe5sJnRiUv4JXksOOSh3 T1WnKnzE2EBTtEqpH8g97xXBXY9OF1kyZMgvLu5X53NII6EOzGd79UVlL+a1rslJKXF1 rPvAQ/KFSxJWibKYEePqKk2+x+o6W+y7iG3CR6dN+2E3SdHK4VLfy7iS59ly+vUHlWQs 6krzNeyJNJM90f8cqGIGQwcJcKq+6IwxBAZE4B17TH2gtcvO/ZgfnUTKTx6ihiVxOMSN uz5Yg/d5fTC4tFNNUU7OqLW/HKt84+oMgHdXEwmkJ3vDjJSkDXBNQ8cfmWITLSKGN9sE Jo4w== 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=DtQmDM1bjxYXcqNKxDIhe3kpTPPYxiOv+5lbfQfOZdE=; b=GHB6MbSJ9qykPDvj32BWE/WftwC4aHapVMv51iVs1br+S1jTvK8ldD2mhlMF21sltU ybUslJwFtIQ4KBo5UUSk+3aGxFd0vE1I2OTiHEvYc1tHwbamgHw32yiihjuYWd8fnSwV MK69pmn1nRi5dMaKxls7qO9lpiISsWjTY8YzRaYmXkOUMF/YIsYdJK5n4NW9/I7crsMm GANp7WIwzypa6h/aS8jV03f5ulAgIz8fyKuOmehd/mYwm3WOoDXGAW5NQq6wTucC2pmK 02kVlkTxQYnsO7bTaHO9n7t7TxTNFjrY32OSH9iYqoqQj+vI9iDFMrH4zKoGIjDbo2W7 sLXA== 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 f20si366106pfn.166.2019.07.02.17.58.59; Tue, 02 Jul 2019 17:59:14 -0700 (PDT) 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 S1727462AbfGCA6V (ORCPT + 99 others); Tue, 2 Jul 2019 20:58:21 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:39114 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727074AbfGCA6V (ORCPT ); Tue, 2 Jul 2019 20:58:21 -0400 Received: by mail-oi1-f194.google.com with SMTP id m202so599484oig.6; Tue, 02 Jul 2019 17:58:20 -0700 (PDT) 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=DtQmDM1bjxYXcqNKxDIhe3kpTPPYxiOv+5lbfQfOZdE=; b=rdNe1uBrDpAhqLxbcDYjpTEaSwGuI+OGS7FawePaNtE4XaFxFX9LZRkySKagywu96E 5elS2OlM2+9SQgOMAHfPsD14tq/9GPSsyXTBQ3v1vpiNeL6mut71AVMzDUmgoKvcaFjG ZkG0TM63qOs8T6VRpCXd6HLvZitCUOj8H6AqM607XGa9sNMZxcj5Tj3Dgs6HVZi8+ESR xkOnd3jnmRURIOnkuqQO34Ubry6C0J+SGZG6KYYpQEfIBOlBi11jTR0PdknRRl+Zli6X R2bK6l6wqZo8BNKUpi7f8TOuuWmeQSAPLRaOIjTworkSmjVLbbO8vJl2DBuaJCC4r6ZZ FONQ== X-Gm-Message-State: APjAAAUu5rtSqVJRCWOmfmBKZQ6UUYSPd1ThQtxFvCoFJrs/jqDCbwzs OVV69Bmzj+Eqt4CMigJrY+ILGKuHCGs= X-Received: by 2002:a63:f342:: with SMTP id t2mr30570356pgj.83.1562101035558; Tue, 02 Jul 2019 13:57:15 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id d26sm16963231pfn.29.2019.07.02.13.57.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 13:57:13 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id DC91A40251; Tue, 2 Jul 2019 20:57:12 +0000 (UTC) Date: Tue, 2 Jul 2019 20:57:12 +0000 From: Luis Chamberlain To: Brendan Higgins Cc: Frank Rowand , Greg KH , Josh Poimboeuf , Kees Cook , Kieran Bingham , Peter Zijlstra , Rob Herring , Stephen Boyd , shuah , Theodore Ts'o , Masahiro Yamada , devicetree , dri-devel , kunit-dev@googlegroups.com, "open list:DOCUMENTATION" , linux-fsdevel@vger.kernel.org, linux-kbuild , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , linux-nvdimm , linux-um@lists.infradead.org, Sasha Levin , "Bird, Timothy" , Amir Goldstein , Dan Carpenter , Daniel Vetter , Jeff Dike , Joel Stanley , Julia Lawall , Kevin Hilman , Knut Omang , Logan Gunthorpe , Michael Ellerman , Petr Mladek , Randy Dunlap , Richard Weinberger , David Rientjes , Steven Rostedt , wfg@linux.intel.com Subject: Re: [PATCH v5 07/18] kunit: test: add initial tests Message-ID: <20190702205712.GS19023@42.do-not-panic.com> References: <20190617082613.109131-1-brendanhiggins@google.com> <20190617082613.109131-8-brendanhiggins@google.com> <20190625232249.GS19023@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Tue, Jul 02, 2019 at 10:52:50AM -0700, Brendan Higgins wrote: > On Wed, Jun 26, 2019 at 12:53 AM Brendan Higgins > wrote: > > > > On Tue, Jun 25, 2019 at 4:22 PM Luis Chamberlain wrote: > > > > > > On Mon, Jun 17, 2019 at 01:26:02AM -0700, Brendan Higgins wrote: > > > > diff --git a/kunit/example-test.c b/kunit/example-test.c > > > > new file mode 100644 > > > > index 0000000000000..f44b8ece488bb > > > > --- /dev/null > > > > +++ b/kunit/example-test.c > > > > > > <-- snip --> > > > > > > > +/* > > > > + * This defines a suite or grouping of tests. > > > > + * > > > > + * Test cases are defined as belonging to the suite by adding them to > > > > + * `kunit_cases`. > > > > + * > > > > + * Often it is desirable to run some function which will set up things which > > > > + * will be used by every test; this is accomplished with an `init` function > > > > + * which runs before each test case is invoked. Similarly, an `exit` function > > > > + * may be specified which runs after every test case and can be used to for > > > > + * cleanup. For clarity, running tests in a test module would behave as follows: > > > > + * > > > > > > To be clear this is not the kernel module init, but rather the kunit > > > module init. I think using kmodule would make this clearer to a reader. > > > > Seems reasonable. Will fix in next revision. > > > > > > + * module.init(test); > > > > + * module.test_case[0](test); > > > > + * module.exit(test); > > > > + * module.init(test); > > > > + * module.test_case[1](test); > > > > + * module.exit(test); > > > > + * ...; > > > > + */ > > Do you think it might be clearer yet to rename `struct kunit_module > *module;` to `struct kunit_suite *suite;`? Yes. Definitely. Or struct kunit_test. Up to you. Luis