Skip to contentSkip to conversation

lib: add module support to string tests

PATCH Applied Geert Uytterhoeven 1 participant 1 message Sep 14, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: add module support to string tests

Extract the string test code into its own source file, to allow to compile it either to a loadable module, or builtin into the kernel.

Fixes 03270c13c5ffaa6a ("lib/string.c: add testcases for memset16/32/64")
---
 lib/Kconfig       |   2 +-
 lib/Makefile      |   1 +
 lib/string.c      | 141 ------------------------------------------------------
 lib/test_string.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 143 insertions(+), 142 deletions(-)
 create mode 100644 lib/test_string.c
lib/Kconfig +1 -1
index a85e6f76add5c914..7c013b5ca19ed240 100644
@@ -573,6 +573,6 @@ config PRIME_NUMBERS
 	tristate
 
 config STRING_SELFTEST
-	bool "Test string functions"
+	tristate "Test string functions"
 
 endmenu
lib/Makefile +1 -0
index 469ce5e24e4f9bb6..917d08a2e685d6e8 100644
@@ -39,6 +39,7 @@ obj-y += bcd.o div64.o sort.o parser.o debug_locks.o random32.o \
 	 bsearch.o find_bit.o llist.o memweight.o kfifo.o \
 	 percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o \
 	 once.o refcount.o usercopy.o errseq.o
+obj-$(CONFIG_STRING_SELFTEST) += test_string.o
 obj-y += string_helpers.o
 obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
 obj-y += hexdump.o
lib/string.c +0 -141

144 lines not on this page · raw message

lib/test_string.c new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
2.7.4