diff options
| author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-11-06 11:32:39 +0100 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2025-11-14 11:02:34 -0700 |
| commit | 7bc16e72ddb993d706f698c2f6cee694e485f557 (patch) | |
| tree | 55dd89c883a3fafa639044915f483053ea8f1783 /lib/kunit/executor.c | |
| parent | 9de5f847ef8fa205f4fd704a381d32ecb5b66da9 (diff) | |
kunit: Make filter parameters configurable via Kconfig
Enable the preset of filter parameters from kconfig options, similar to
how other KUnit configuration parameters are handled already.
This is useful to run a subset of tests even if the cmdline is not
readily modifyable.
Link: https://lore.kernel.org/r/20251106-kunit-filter-kconfig-v1-1-d723fb7ac221@linutronix.de
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/kunit/executor.c')
| -rw-r--r-- | lib/kunit/executor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c index 0061d4c7e351..02ff380ab793 100644 --- a/lib/kunit/executor.c +++ b/lib/kunit/executor.c @@ -45,9 +45,11 @@ bool kunit_autorun(void) return autorun_param; } -static char *filter_glob_param; -static char *filter_param; -static char *filter_action_param; +#define PARAM_FROM_CONFIG(config) (config[0] ? config : NULL) + +static char *filter_glob_param = PARAM_FROM_CONFIG(CONFIG_KUNIT_DEFAULT_FILTER_GLOB); +static char *filter_param = PARAM_FROM_CONFIG(CONFIG_KUNIT_DEFAULT_FILTER); +static char *filter_action_param = PARAM_FROM_CONFIG(CONFIG_KUNIT_DEFAULT_FILTER_ACTION); module_param_named(filter_glob, filter_glob_param, charp, 0600); MODULE_PARM_DESC(filter_glob, |
