@@ -277,7 +277,8 @@ static inline int kunit_run_all_tests(void)
{ \
return __kunit_test_suites_exit(__suites); \
} \
- module_exit(kunit_test_suites_exit)
+ module_exit(kunit_test_suites_exit) \
+ MODULE_INFO(test, "Y");
#else
#define kunit_test_suites_for_module(__suites)
#endif /* MODULE */
@@ -11,6 +11,7 @@
#include <kunit/test-bug.h>
#include <linux/kernel.h>
#include <linux/moduleparam.h>
+#include <linux/panic.h>
#include <linux/sched/debug.h>
#include <linux/sched.h>
@@ -501,6 +502,9 @@ int kunit_run_tests(struct kunit_suite *suite)
struct kunit_result_stats suite_stats = { 0 };
struct kunit_result_stats total_stats = { 0 };
+ /* Taint the kernel so we know we've run tests. */
+ add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
+
if (suite->suite_init) {
suite->suite_init_err = suite->suite_init(suite);
if (suite->suite_init_err) {