aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tests/Makefile
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-04-26 17:21:01 -0700
committerKees Cook <kees@kernel.org>2025-05-08 09:42:40 -0700
commitb370f7eacdcfe1dd17bee00506296aa3fdc773cb (patch)
treef1ef8051b43d1eed8b0d215175040e1708f2265b /lib/tests/Makefile
parentrandstruct: gcc-plugin: Remove bogus void member (diff)
downloadlinux-b370f7eacdcfe1dd17bee00506296aa3fdc773cb.tar.gz
linux-b370f7eacdcfe1dd17bee00506296aa3fdc773cb.zip
lib/tests: Add randstruct KUnit test
Perform basic validation about layout randomization and initialization tracking when using CONFIG_RANDSTRUCT=y. Tested using: $ ./tools/testing/kunit/kunit.py run \ --kconfig_add CONFIG_RANDSTRUCT_FULL=y \ randstruct [17:22:30] ================= randstruct (2 subtests) ================== [17:22:30] [PASSED] randstruct_layout [17:22:30] [PASSED] randstruct_initializers [17:22:30] =================== [PASSED] randstruct ==================== [17:22:30] ============================================================ [17:22:30] Testing complete. Ran 2 tests: passed: 2 [17:22:30] Elapsed time: 5.091s total, 0.001s configuring, 4.974s building, 0.086s running Adding "--make_option LLVM=1" can be used to test Clang, which also passes. Acked-by: David Gow <davidgow@google.com> Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'lib/tests/Makefile')
-rw-r--r--lib/tests/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tests/Makefile b/lib/tests/Makefile
index 5a4794c1826e..56d645014482 100644
--- a/lib/tests/Makefile
+++ b/lib/tests/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_MEMCPY_KUNIT_TEST) += memcpy_kunit.o
CFLAGS_overflow_kunit.o = $(call cc-disable-warning, tautological-constant-out-of-range-compare)
obj-$(CONFIG_OVERFLOW_KUNIT_TEST) += overflow_kunit.o
obj-$(CONFIG_PRINTF_KUNIT_TEST) += printf_kunit.o
+obj-$(CONFIG_RANDSTRUCT_KUNIT_TEST) += randstruct_kunit.o
obj-$(CONFIG_SCANF_KUNIT_TEST) += scanf_kunit.o
obj-$(CONFIG_SIPHASH_KUNIT_TEST) += siphash_kunit.o
obj-$(CONFIG_SLUB_KUNIT_TEST) += slub_kunit.o