Skip to content

Commit 40eb5cf

Browse files
melvershuahkh
authored andcommitted
kasan: test: make use of kunit_skip()
Make use of the recently added kunit_skip() to skip tests, as it permits TAP parsers to recognize if a test was deliberately skipped. Signed-off-by: Marco Elver <[email protected]> Signed-off-by: David Gow <[email protected]> Reviewed-by: Daniel Latypov <[email protected]> Reviewed-by: Andrey Konovalov <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent d99ea67 commit 40eb5cf

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/test_kasan.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,13 @@ static void kasan_test_exit(struct kunit *test)
111111
} while (0)
112112

113113
#define KASAN_TEST_NEEDS_CONFIG_ON(test, config) do { \
114-
if (!IS_ENABLED(config)) { \
115-
kunit_info((test), "skipping, " #config " required"); \
116-
return; \
117-
} \
114+
if (!IS_ENABLED(config)) \
115+
kunit_skip((test), "Test requires " #config "=y"); \
118116
} while (0)
119117

120118
#define KASAN_TEST_NEEDS_CONFIG_OFF(test, config) do { \
121-
if (IS_ENABLED(config)) { \
122-
kunit_info((test), "skipping, " #config " enabled"); \
123-
return; \
124-
} \
119+
if (IS_ENABLED(config)) \
120+
kunit_skip((test), "Test requires " #config "=n"); \
125121
} while (0)
126122

127123
static void kmalloc_oob_right(struct kunit *test)

0 commit comments

Comments
 (0)