diff options
| author | Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> | 2024-10-28 21:54:52 +0000 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2025-01-15 09:04:06 -0700 |
| commit | 31691914c392675bdc65d1e72dd8d129a1f0014f (patch) | |
| tree | a85aa8ad226c4969aed1af14cf9411680a7331e7 /include/kunit | |
| parent | 220374e70b0b9d44ab5ec1106bc16caf20f94d80 (diff) | |
kunit: Introduce autorun option
The new option controls tests run on boot or module load. With the new
debugfs "run" dentry allowing to run tests on demand, an ability to disable
automatic tests run becomes a useful option in case of intrusive tests.
The option is set to true by default to preserve the existent behavior. It
can be overridden by either the corresponding module option or by the
corresponding config build option.
Link: https://lore.kernel.org/r/173015245931.4747.16419517391658830640.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Rae Moar <rmoar@google.com>
Acked-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'include/kunit')
| -rw-r--r-- | include/kunit/test.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/kunit/test.h b/include/kunit/test.h index 34b71e42fb10..58dbab60f853 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -312,6 +312,7 @@ static inline void kunit_set_failure(struct kunit *test) } bool kunit_enabled(void); +bool kunit_autorun(void); const char *kunit_action(void); const char *kunit_filter_glob(void); char *kunit_filter(void); @@ -334,7 +335,8 @@ kunit_filter_suites(const struct kunit_suite_set *suite_set, int *err); void kunit_free_suite_set(struct kunit_suite_set suite_set); -int __kunit_test_suites_init(struct kunit_suite * const * const suites, int num_suites); +int __kunit_test_suites_init(struct kunit_suite * const * const suites, int num_suites, + bool run_tests); void __kunit_test_suites_exit(struct kunit_suite **suites, int num_suites); |