From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f196.google.com ([209.85.210.196]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hiPq0-0007Pd-SP for linux-um@lists.infradead.org; Tue, 02 Jul 2019 20:57:18 +0000 Received: by mail-pf1-f196.google.com with SMTP id c85so47838pfc.1 for ; Tue, 02 Jul 2019 13:57:16 -0700 (PDT) Date: Tue, 2 Jul 2019 20:57:12 +0000 From: Luis Chamberlain 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-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Brendan Higgins Cc: Petr Mladek , "open list:DOCUMENTATION" , Peter Zijlstra , Amir Goldstein , dri-devel , Sasha Levin , Masahiro Yamada , Michael Ellerman , "open list:KERNEL SELFTEST FRAMEWORK" , shuah , Rob Herring , linux-nvdimm , Frank Rowand , Knut Omang , Kieran Bingham , wfg@linux.intel.com, Joel Stanley , David Rientjes , Jeff Dike , Dan Carpenter , devicetree , linux-kbuild , "Bird, Timothy , linux-um@lists.infradead.org, Steven Rostedt" , Julia Lawall , Josh Poimboeuf , kunit-dev@googlegroups.com, Theodore Ts'o , Richard Weinberger , Stephen Boyd , Greg KH , Randy Dunlap , Linux Kernel Mailing List , Daniel Vetter , Kees Cook , linux-fsdevel@vger.kernel.org, Logan Gunthorpe , Kevin Hilman 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 _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um