diff options
author | Rae Moar <rmoar@google.com> | 2023-12-13 19:44:17 +0000 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2023-12-18 13:21:15 -0700 |
commit | d81f0d7b8b23ec79f80be602ed6129ded27862e8 (patch) | |
tree | 2ad32958ea62db0dd0f2b2324be9c8596f9a73cd /kernel | |
parent | 69dfdce1c5161a37a14720e5f6f62a36e387aa33 (diff) | |
download | linux-stable-d81f0d7b8b23ec79f80be602ed6129ded27862e8.tar.gz linux-stable-d81f0d7b8b23ec79f80be602ed6129ded27862e8.tar.bz2 linux-stable-d81f0d7b8b23ec79f80be602ed6129ded27862e8.zip |
kunit: add KUNIT_INIT_TABLE to init linker section
Add KUNIT_INIT_TABLE to the INIT_DATA linker section.
Alter the KUnit macros to create init tests:
kunit_test_init_section_suites
Update lib/kunit/executor.c to run both the suites in KUNIT_TABLE and
KUNIT_INIT_TABLE.
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Rae Moar <rmoar@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/module/main.c b/kernel/module/main.c index 98fedfdb8db5..36681911c05a 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2199,6 +2199,9 @@ static int find_module_sections(struct module *mod, struct load_info *info) mod->kunit_suites = section_objs(info, ".kunit_test_suites", sizeof(*mod->kunit_suites), &mod->num_kunit_suites); + mod->kunit_init_suites = section_objs(info, ".kunit_init_test_suites", + sizeof(*mod->kunit_init_suites), + &mod->num_kunit_init_suites); #endif mod->extable = section_objs(info, "__ex_table", |