lib: kunit: add test_min_heap test conversion to KUnit
Subsystems (2)
PATCH RESEND v2 1/1 lib: kunit: add test_min_heap test conversion to KUnit
This adds the conversion of the runtime tests of test_min_heap, from lib/test_min_heap.c to KUnit tests.
Signed-off-by Vitor Massaru Iha <[email protected]>
---
v2:
* change Kconfig entries to be more adherent to KUnit documentation, min_heap test runs when enabling full test coverage (KUNIT_ALL_TESTS).
* make kconfig help more concise;
* fix KUNIT_TEST sufix;
---
lib/Kconfig.debug | 24 +++--
lib/Makefile | 2 +-
lib/{test_min_heap.c => min_heap_kunit.c} | 117 ++++++++++++----------
3 files changed, 78 insertions(+), 65 deletions(-)
rename lib/{test_min_heap.c => min_heap_kunit.c} (60%)lib/Kconfig.debug +14 -10
@@ -1915,16 +1915,6 @@ config TEST_LIST_SORT If unsure, say N. -config TEST_MIN_HEAP - tristate "Min heap test" - depends on DEBUG_KERNEL || m - help - Enable this to turn on min heap function tests. This test is - executed only once during system boot (so affects only boot time), - or at module load time. - - If unsure, say N. - config TEST_SORT tristate "Array-based sort test" depends on DEBUG_KERNEL || m
@@ -2256,6 +2246,20 @@ config BITS_TEST If unsure, say N. +config MIN_HEAP_KUNIT_TEST + tristate "KUnit test for Min heap" if !KUNIT_ALL_TESTS + depends on KUNIT + default KUNIT_ALL_TESTS + help + Enable this to turn on min heap function tests. This test is + executed only once during system boot (so affects only boot time), + or at module load time. + + For more information on KUnit and unit tests in general please refer + to the KUnit documentation in Documentation/dev-tools/kunit/. + + If unsure, say N. + config TEST_UDELAY tristate "udelay test driver" help
lib/Makefile +1 -1
@@ -68,7 +68,6 @@ CFLAGS_test_ubsan.o += $(call cc-disable-warning, vla) UBSAN_SANITIZE_test_ubsan.o := y obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o obj-$(CONFIG_TEST_LIST_SORT) += test_list_sort.o -obj-$(CONFIG_TEST_MIN_HEAP) += test_min_heap.o obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_VMALLOC) += test_vmalloc.o obj-$(CONFIG_TEST_OVERFLOW) += test_overflow.o
@@ -343,3 +342,4 @@ obj-$(CONFIG_BITFIELD_KUNIT) += bitfield_kunit.o obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o obj-$(CONFIG_BITS_TEST) += test_bits.o +obj-$(CONFIG_MIN_HEAP_KUNIT_TEST) += min_heap_kunit.o
lib/min_heap_kunit.c renamed from lib/test_min_heap.c +63 -54
207 lines not on this page · raw message
base-commit: d2585f5164c298aaaed14c2c8d313cbe7bd5b253
Signature · 6 lines
2.26.2 _______________________________________________ Linux-kernel-mentees mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees