string: Convert selftests to KUnit
cover string: Convert selftests to KUnit
Hi,
I realized the string selftests hadn't been converted to KUnit yet. Do that.
-Kees
Kees Cook (2):
string: Convert selftest to KUnit
string: Convert helpers selftest to KUnit
MAINTAINERS | 4 +-
lib/Kconfig.debug | 12 +-
lib/Makefile | 4 +-
...tring_helpers.c => string_helpers_kunit.c} | 160 +++++++++--------
lib/{test_string.c => string_kunit.c} | 166 ++++++------------
5 files changed, 154 insertions(+), 192 deletions(-)
rename lib/{test-string_helpers.c => string_helpers_kunit.c} (79%)
rename lib/{test_string.c => string_kunit.c} (54%)Signature · 1 line
2.34.1
PATCH 1/2 string: Convert selftest to KUnit
Convert test_string.c to KUnit so it can be easily run with everything else.
---
Cc: Andy Shevchenko <[email protected]>
Cc: [email protected]
---
MAINTAINERS | 2 +-
lib/Kconfig.debug | 6 +-
lib/Makefile | 2 +-
lib/{test_string.c => string_kunit.c} | 166 +++++++++-----------------
4 files changed, 61 insertions(+), 115 deletions(-)
rename lib/{test_string.c => string_kunit.c} (54%)MAINTAINERS +1 -1
@@ -8976,9 +8976,9 @@ F: include/linux/string.h F: include/linux/string_choices.h F: include/linux/string_helpers.h F: lib/string.c +F: lib/string_kunit.c F: lib/string_helpers.c F: lib/test-string_helpers.c -F: lib/test_string.c F: scripts/coccinelle/api/string_choices.cocci GENERIC UIO DRIVER FOR PCI DEVICES
lib/Kconfig.debug +4 -2
@@ -2352,8 +2352,10 @@ config ASYNC_RAID6_TEST config TEST_HEXDUMP tristate "Test functions located in the hexdump module at runtime" -config STRING_SELFTEST - tristate "Test string functions at runtime" +config STRING_KUNIT_TEST + tristate "KUnit test string functions at runtime" if !KUNIT_ALL_TESTS + depends on KUNIT + default KUNIT_ALL_TESTS config TEST_STRING_HELPERS tristate "Test functions located in the string_helpers module at runtime"
lib/Makefile +1 -1
@@ -49,7 +49,7 @@ obj-y += bcd.o sort.o parser.o debug_locks.o random32.o \ percpu-refcount.o rhashtable.o base64.o \ once.o refcount.o rcuref.o usercopy.o errseq.o bucket_locks.o \ generic-radix-tree.o bitmap-str.o -obj-$(CONFIG_STRING_SELFTEST) += test_string.o +obj-$(CONFIG_STRING_KUNIT_TEST) += string_kunit.o obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += hexdump.o
lib/string_kunit.c renamed from lib/test_string.c +55 -111
293 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 2/2 string: Convert helpers selftest to KUnit
In reply to Kees CookConvert test-string_helpers.c to KUnit so it can be easily run with everything else.
---
Cc: Andy Shevchenko <[email protected]>
Cc: [email protected]
---
MAINTAINERS | 2 +-
lib/Kconfig.debug | 6 +-
lib/Makefile | 2 +-
...tring_helpers.c => string_helpers_kunit.c} | 160 ++++++++++--------
4 files changed, 93 insertions(+), 77 deletions(-)
rename lib/{test-string_helpers.c => string_helpers_kunit.c} (79%)MAINTAINERS +1 -1
@@ -8978,7 +8978,7 @@ F: include/linux/string_helpers.h F: lib/string.c F: lib/string_kunit.c F: lib/string_helpers.c -F: lib/test-string_helpers.c +F: lib/string_helpers_kunit.c F: scripts/coccinelle/api/string_choices.cocci GENERIC UIO DRIVER FOR PCI DEVICES
lib/Kconfig.debug +4 -2
@@ -2357,8 +2357,10 @@ config STRING_KUNIT_TEST depends on KUNIT default KUNIT_ALL_TESTS -config TEST_STRING_HELPERS - tristate "Test functions located in the string_helpers module at runtime" +config STRING_HELPERS_KUNIT_TEST + tristate "KUnit test string helpers at runtime" if !KUNIT_ALL_TESTS + depends on KUNIT + default KUNIT_ALL_TESTS config TEST_KSTRTOX tristate "Test kstrto*() family of functions at runtime"
lib/Makefile +1 -1
@@ -51,7 +51,7 @@ obj-y += bcd.o sort.o parser.o debug_locks.o random32.o \ generic-radix-tree.o bitmap-str.o obj-$(CONFIG_STRING_KUNIT_TEST) += string_kunit.o obj-y += string_helpers.o -obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o +obj-$(CONFIG_STRING_HELPERS_KUNIT_TEST) += string_helpers_kunit.o obj-y += hexdump.o obj-$(CONFIG_TEST_HEXDUMP) += test_hexdump.o obj-y += kstrtox.o
lib/string_helpers_kunit.c renamed from lib/test-string_helpers.c +87 -73
321 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH 2/2] string: Convert helpers selftest to KUnit
Quoted 2 lines · Kees Cook
Convert
test-string_helpers.cto KUnit so it can be easily run with everything else.
Gah, I will send a v2. I thought I was doing this on top of the get_size() change, but I didn't...
Signature · 1 line
Kees Cook