summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/test.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-08-24 11:46:52 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-09-16 13:57:46 +0200
commit2c6ea4e2cefe2e86af782a5b8e1070f4d434f2f2 (patch)
tree7120f7cb51581c70ed207203cccb28145740a666 /drivers/thunderbolt/test.c
parentthunderbolt: Only stop control channel when entering freeze (diff)
downloadlinux-2c6ea4e2cefe2e86af782a5b8e1070f4d434f2f2.tar.xz
linux-2c6ea4e2cefe2e86af782a5b8e1070f4d434f2f2.zip
thunderbolt: Allow KUnit tests to be built also when CONFIG_USB4=m
This adds a bit more build coverage for the tests even though these are not expected to be enabled by normal users and distros. In order to make this working we need to open-code kunit_test_suite() and call the relevant functions directly in the driver init/exit hook. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/test.c')
-rw-r--r--drivers/thunderbolt/test.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/thunderbolt/test.c b/drivers/thunderbolt/test.c
index a4d78811f7e2..464c2d37b992 100644
--- a/drivers/thunderbolt/test.c
+++ b/drivers/thunderbolt/test.c
@@ -1623,4 +1623,15 @@ static struct kunit_suite tb_test_suite = {
.name = "thunderbolt",
.test_cases = tb_test_cases,
};
-kunit_test_suite(tb_test_suite);
+
+static struct kunit_suite *tb_test_suites[] = { &tb_test_suite, NULL };
+
+int tb_test_init(void)
+{
+ return __kunit_test_suites_init(tb_test_suites);
+}
+
+void tb_test_exit(void)
+{
+ return __kunit_test_suites_exit(tb_test_suites);
+}