kcsan: Make test follow KUnit style recommendations
authorMarco Elver <elver@google.com>
Wed, 13 Jan 2021 16:05:56 +0000 (17:05 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 8 Mar 2021 22:27:43 +0000 (14:27 -0800)
Per recently added KUnit style recommendations at
Documentation/dev-tools/kunit/style.rst, make the following changes to
the KCSAN test:

1. Rename 'kcsan-test.c' to 'kcsan_test.c'.

2. Rename suite name 'kcsan-test' to 'kcsan'.

3. Rename CONFIG_KCSAN_TEST to CONFIG_KCSAN_KUNIT_TEST and
   default to KUNIT_ALL_TESTS.

Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/kcsan/Makefile
kernel/kcsan/kcsan_test.c [moved from kernel/kcsan/kcsan-test.c with 99% similarity]
lib/Kconfig.kcsan

index 65ca553..c2bb07f 100644 (file)
@@ -13,5 +13,5 @@ CFLAGS_core.o := $(call cc-option,-fno-conserve-stack) \
 obj-y := core.o debugfs.o report.o
 obj-$(CONFIG_KCSAN_SELFTEST) += selftest.o
 
-CFLAGS_kcsan-test.o := $(CFLAGS_KCSAN) -g -fno-omit-frame-pointer
-obj-$(CONFIG_KCSAN_TEST) += kcsan-test.o
+CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -g -fno-omit-frame-pointer
+obj-$(CONFIG_KCSAN_KUNIT_TEST) += kcsan_test.o
similarity index 99%
rename from kernel/kcsan/kcsan-test.c
rename to kernel/kcsan/kcsan_test.c
index ebe7fd2..f16f632 100644 (file)
@@ -1156,7 +1156,7 @@ static void test_exit(struct kunit *test)
 }
 
 static struct kunit_suite kcsan_test_suite = {
-       .name = "kcsan-test",
+       .name = "kcsan",
        .test_cases = kcsan_test_cases,
        .init = test_init,
        .exit = test_exit,
index f271ff5..0440f37 100644 (file)
@@ -69,8 +69,9 @@ config KCSAN_SELFTEST
          panic. Recommended to be enabled, ensuring critical functionality
          works as intended.
 
-config KCSAN_TEST
-       tristate "KCSAN test for integrated runtime behaviour"
+config KCSAN_KUNIT_TEST
+       tristate "KCSAN test for integrated runtime behaviour" if !KUNIT_ALL_TESTS
+       default KUNIT_ALL_TESTS
        depends on TRACEPOINTS && KUNIT
        select TORTURE_TEST
        help