lkml.org 
[lkml]   [2018]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v3 01/19] kunit: test: add KUnit test runner core
> +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

\
 
 \ /
  Last update: 2018-11-30 04:29    [W:0.514 / U:8.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site