linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] module: kunit: Load .kunit_test_suites section when CONFIG_KUNIT=m
@ 2022-07-13  0:52 David Gow
  2022-07-13 15:24 ` Daniel Latypov
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: David Gow @ 2022-07-13  0:52 UTC (permalink / raw)
  To: Brendan Higgins, Shuah Khan, Daniel Latypov, Luis Chamberlain,
	Jeremy Kerr
  Cc: David Gow, linux-modules, kunit-dev, linux-kselftest,
	Linux Kernel Mailing List

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: 3d6e44623841 ("kunit: unify module and builtin suite definitions")
Signed-off-by: David Gow <davidgow@google.com>
---
 kernel/module/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/module/main.c b/kernel/module/main.c
index 324a770f789c..222a0b7263b6 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2094,7 +2094,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);
-- 
2.37.0.144.g8ac04bfd2-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-12  8:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-13  0:52 [PATCH] module: kunit: Load .kunit_test_suites section when CONFIG_KUNIT=m David Gow
2022-07-13 15:24 ` Daniel Latypov
2022-07-19 17:58   ` Luis Chamberlain
2022-07-20  9:26     ` David Gow
2022-07-20 20:29       ` Luis Chamberlain
2022-07-28  8:42         ` David Gow
2022-08-03 20:31           ` Brendan Higgins
2022-07-19 17:57 ` Luis Chamberlain
2022-07-20  9:32   ` David Gow
2022-08-03 20:32 ` Brendan Higgins
2022-08-12  8:07 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).