mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
Add KUnit tests for the kfifo data structure. They test the vast majority of macros defined in the kfifo header (include/linux/kfifo.h). These are inspired by the existing tests for the doubly linked list in lib/tests/list-test.c (previously at lib/list-test.c) [1]. Note that this patch depends on the patch that moves the KUnit tests on lib/ into lib/tests/ [2]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/list-test.c?h=v6.11-rc6 [2] https://lore.kernel.org/all/20240720181025.work.002-kees@kernel.org/ Signed-off-by: Diego Vieira <diego.daniel.professional@gmail.com> Reviewed-by: David Gow <davidgow@google.com> Reviewed-by: Rae Moar <rmoar@google.com> Link: https://lore.kernel.org/r/20241202075545.3648096-5-davidgow@google.com Signed-off-by: Kees Cook <kees@kernel.org>
43 lines
2.0 KiB
Makefile
43 lines
2.0 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for tests of kernel library functions.
|
|
|
|
# KUnit tests
|
|
CFLAGS_bitfield_kunit.o := $(DISABLE_STRUCTLEAK_PLUGIN)
|
|
obj-$(CONFIG_BITFIELD_KUNIT) += bitfield_kunit.o
|
|
obj-$(CONFIG_BITS_TEST) += test_bits.o
|
|
obj-$(CONFIG_CHECKSUM_KUNIT) += checksum_kunit.o
|
|
obj-$(CONFIG_CMDLINE_KUNIT_TEST) += cmdline_kunit.o
|
|
obj-$(CONFIG_CPUMASK_KUNIT_TEST) += cpumask_kunit.o
|
|
obj-$(CONFIG_CRC_KUNIT_TEST) += crc_kunit.o
|
|
CFLAGS_fortify_kunit.o += $(call cc-disable-warning, unsequenced)
|
|
CFLAGS_fortify_kunit.o += $(call cc-disable-warning, stringop-overread)
|
|
CFLAGS_fortify_kunit.o += $(call cc-disable-warning, stringop-truncation)
|
|
CFLAGS_fortify_kunit.o += $(DISABLE_STRUCTLEAK_PLUGIN)
|
|
obj-$(CONFIG_FORTIFY_KUNIT_TEST) += fortify_kunit.o
|
|
CFLAGS_test_fprobe.o += $(CC_FLAGS_FTRACE)
|
|
obj-$(CONFIG_FPROBE_SANITY_TEST) += test_fprobe.o
|
|
obj-$(CONFIG_HASHTABLE_KUNIT_TEST) += hashtable_test.o
|
|
obj-$(CONFIG_HASH_KUNIT_TEST) += test_hash.o
|
|
obj-$(CONFIG_TEST_IOV_ITER) += kunit_iov_iter.o
|
|
obj-$(CONFIG_IS_SIGNED_TYPE_KUNIT_TEST) += is_signed_type_kunit.o
|
|
obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
|
|
obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o
|
|
obj-$(CONFIG_KFIFO_KUNIT_TEST) += kfifo_kunit.o
|
|
obj-$(CONFIG_TEST_LIST_SORT) += test_list_sort.o
|
|
obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o
|
|
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_SIPHASH_KUNIT_TEST) += siphash_kunit.o
|
|
obj-$(CONFIG_SLUB_KUNIT_TEST) += slub_kunit.o
|
|
obj-$(CONFIG_TEST_SORT) += test_sort.o
|
|
CFLAGS_stackinit_kunit.o += $(call cc-disable-warning, switch-unreachable)
|
|
obj-$(CONFIG_STACKINIT_KUNIT_TEST) += stackinit_kunit.o
|
|
obj-$(CONFIG_STRING_KUNIT_TEST) += string_kunit.o
|
|
obj-$(CONFIG_STRING_HELPERS_KUNIT_TEST) += string_helpers_kunit.o
|
|
obj-$(CONFIG_USERCOPY_KUNIT_TEST) += usercopy_kunit.o
|
|
obj-$(CONFIG_UTIL_MACROS_KUNIT) += util_macros_kunit.o
|
|
|
|
obj-$(CONFIG_TEST_RUNTIME_MODULE) += module/
|