Commit 40eb5cf4 authored by Marco Elver's avatar Marco Elver Committed by Shuah Khan
Browse files

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: default avatarMarco Elver <elver@google.com>
Signed-off-by: default avatarDavid Gow <davidgow@google.com>
Reviewed-by: default avatarDaniel Latypov <dlatypov@google.com>
Reviewed-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent d99ea675
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -111,17 +111,13 @@ static void kasan_test_exit(struct kunit *test)
} while (0)

#define KASAN_TEST_NEEDS_CONFIG_ON(test, config) do {			\
	if (!IS_ENABLED(config)) {					\
		kunit_info((test), "skipping, " #config " required");	\
		return;							\
	}								\
	if (!IS_ENABLED(config))					\
		kunit_skip((test), "Test requires " #config "=y");	\
} while (0)

#define KASAN_TEST_NEEDS_CONFIG_OFF(test, config) do {			\
	if (IS_ENABLED(config)) {					\
		kunit_info((test), "skipping, " #config " enabled");	\
		return;							\
	}								\
	if (IS_ENABLED(config))						\
		kunit_skip((test), "Test requires " #config "=n");	\
} while (0)

static void kmalloc_oob_right(struct kunit *test)