lib: add CONFIG_TEST_SORT to enable self-test of sort()
[email protected]
maintainerPATCH 112/124 lib: add CONFIG_TEST_SORT to enable self-test of sort()
From: Kostenzer Felix <[email protected]>
Subject: lib: add CONFIG_TEST_SORT to enable self-test of sort()
Along with the addition made to Kconfig.debug, the prior existing but permanently disabled test function has been slightly refactored.
Patch has been tested using QEMU 2.1.2 with a .config obtained through 'make defconfig' (x86_64) and manually enabling the option.
[[email protected]: move sort self-test into a separate file]
Link http://lkml.kernel.org/r/HE1PR09MB0394B0418D504DCD27167D4FD49B0@HE1PR09MB0394.eurprd09.prod.outlook.com open here
Signed-off-by Kostenzer Felix <[email protected]>
Signed-off-by Arnd Bergmann <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
lib/Kconfig.debug | 8 ++++++++ lib/Makefile | 1 + lib/sort.c | 41 ++--------------------------------------- lib/test_sort.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 39 deletions(-)
lib/Kconfig.debug renamed from lib/Kconfig.debug~lib-add-config_test_sort-to-enable-self-test-of-sort +8 -0
@@ -1739,6 +1739,14 @@ config TEST_LIST_SORT If unsure, say N. +config TEST_SORT + bool "Array-based sort test" + depends on DEBUG_KERNEL + help + This option enables the self-test function of 'sort()' at boot. + + If unsure, say N. + config KPROBES_SANITY_TEST bool "Kprobes sanity tests" depends on DEBUG_KERNEL
lib/Makefile renamed from lib/Makefile~lib-add-config_test_sort-to-enable-self-test-of-sort +1 -0
@@ -50,6 +50,7 @@ obj-$(CONFIG_TEST_KASAN) += test_kasan.o obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_RHASHTABLE) += test_rhashtable.o +obj-$(CONFIG_TEST_SORT) += test_sort.o obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_keys.o obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_key_base.o
lib/sort.c renamed from lib/sort.c~lib-add-config_test_sort-to-enable-self-test-of-sort +2 -39
50 lines not on this page · raw message
lib/test_sort.c new file +43 -0
43 lines not on this page · raw message
_