Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-12-06 Thread Anton Ivanov
On 30/11/2018 03:14, Luis Chamberlain wrote: On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: +#define module_test(module) \ + static int module_kunit_init##module(void) \ + { \ + return kunit_run_tests(&module); \ +

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-12-06 Thread Anton Ivanov
On 05/12/2018 14:45, Arnd Bergmann wrote: On Wed, Dec 5, 2018 at 2:42 PM Anton Ivanov wrote: On 30/11/2018 03:14, Luis Chamberlain wrote: On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: Then for the UML stuff, I think if we *really* accept that UML will always be a viable opti

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-12-05 Thread Arnd Bergmann
On Wed, Dec 5, 2018 at 2:42 PM Anton Ivanov wrote: > On 30/11/2018 03:14, Luis Chamberlain wrote: > > On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > > Then for the UML stuff, I think if we *really* accept that UML will > > always be a viable option we should probably consider n

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-12-04 Thread Brendan Higgins
On Fri, Nov 30, 2018 at 7:10 PM Luis Chamberlain wrote: > > On Fri, Nov 30, 2018 at 06:08:36PM -0800, Brendan Higgins wrote: > > On Thu, Nov 29, 2018 at 7:28 PM Luis Chamberlain wrote: > > > > > > > +static void kunit_run_case_internal(struct kunit *test, > > > > +

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-12-02 Thread Brendan Higgins
On Thu, Nov 29, 2018 at 7:14 PM Luis Chamberlain wrote: > > On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > > +#define module_test(module) \ > > + static int module_kunit_init##module(void) \ > > + { \ > > + return kunit_run_tests(&mod

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-12-02 Thread Brendan Higgins
On Thu, Nov 29, 2018 at 7:28 PM Luis Chamberlain wrote: > > > +static void kunit_run_case_internal(struct kunit *test, > > + struct kunit_module *module, > > + struct kunit_case *test_case) > > +{ > > + int ret; > > + > > + if

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Luis Chamberlain
On Fri, Nov 30, 2018 at 06:08:36PM -0800, Brendan Higgins wrote: > On Thu, Nov 29, 2018 at 7:28 PM Luis Chamberlain wrote: > > > > > +static void kunit_run_case_internal(struct kunit *test, > > > + struct kunit_module *module, > > > +

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > +int kunit_run_tests(struct kunit_module *module) > +{ > + bool all_passed = true, success; > + struct kunit_case *test_case; > + struct kunit test; > + int ret; > + > + ret = kunit_init_test(&test, module->name)

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Luis Chamberlain
On Fri, Nov 30, 2018 at 05:51:11PM -0800, Brendan Higgins wrote: > On Thu, Nov 29, 2018 at 7:14 PM Luis Chamberlain wrote: > > > > On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > > > +#define module_test(module) \ > > > + static int module_kunit_init##module(void) \

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-29 Thread Luis Chamberlain
> +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); > +

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > +#define module_test(module) \ > + static int module_kunit_init##module(void) \ > + { \ > + return kunit_run_tests(&module); \ > + } \ > + late_initcall(module_kuni

[RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-29 Thread Brendan Higgins
Add core facilities for defining unit tests; this provides a common way to define test cases, functions that execute code which is under test and determine whether the code under test behaves as expected; this also provides a way to group together related test cases in test suites (here we call the