Skip to content

Commit

Permalink
module: kunit: Load .kunit_test_suites section when CONFIG_KUNIT=m
Browse files Browse the repository at this point in the history
The new KUnit module handling has KUnit test suites listed in a
.kunit_test_suites section of each module. This should be loaded when
the module is, but at the moment this only happens if KUnit is built-in.

Also load this when KUnit is enabled as a module: it'll not be usable
unless KUnit is loaded, but such modules are likely to depend on KUnit
anyway, so it's unlikely to ever be loaded needlessly.

Fixes: 3d6e446 ("kunit: unify module and builtin suite definitions")
Signed-off-by: David Gow <[email protected]>
Reviewed-by: Brendan Higgins <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
  • Loading branch information
sulix authored and shuahkh committed Aug 15, 2022
1 parent d52788b commit 41a5556
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/module/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ static int find_module_sections(struct module *mod, struct load_info *info)
sizeof(*mod->static_call_sites),
&mod->num_static_call_sites);
#endif
#ifdef CONFIG_KUNIT
#if IS_ENABLED(CONFIG_KUNIT)
mod->kunit_suites = section_objs(info, ".kunit_test_suites",
sizeof(*mod->kunit_suites),
&mod->num_kunit_suites);
Expand Down

0 comments on commit 41a5556

Please sign in to comment.