From 2c6ea4e2cefe2e86af782a5b8e1070f4d434f2f2 Mon Sep 17 00:00:00 2001 From: Mika Westerberg Date: Mon, 24 Aug 2020 12:46:52 +0300 Subject: 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 --- drivers/thunderbolt/test.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers/thunderbolt/test.c') 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); +} -- cgit v1.2.3