mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
51104c19d8
For tests that need to allocate using vm_mmap() (e.g. usercopy and execve), provide the interface to have the allocation tracked by KUnit itself. This requires bringing up a placeholder userspace mm. This combines my earlier attempt at this with Mark Rutland's version[1]. Normally alloc_mm() and arch_pick_mmap_layout() aren't exported for modules, so export these only for KUnit testing. Link: https://lore.kernel.org/lkml/20230321122514.1743889-2-mark.rutland@arm.com/ [1] Co-developed-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
30 lines
660 B
Makefile
30 lines
660 B
Makefile
obj-$(CONFIG_KUNIT) += kunit.o
|
|
|
|
kunit-objs += test.o \
|
|
resource.o \
|
|
user_alloc.o \
|
|
static_stub.o \
|
|
string-stream.o \
|
|
assert.o \
|
|
try-catch.o \
|
|
executor.o \
|
|
attributes.o \
|
|
device.o
|
|
|
|
ifeq ($(CONFIG_KUNIT_DEBUGFS),y)
|
|
kunit-objs += debugfs.o
|
|
endif
|
|
|
|
# KUnit 'hooks' are built-in even when KUnit is built as a module.
|
|
obj-y += hooks.o
|
|
|
|
obj-$(CONFIG_KUNIT_TEST) += kunit-test.o
|
|
|
|
# string-stream-test compiles built-in only.
|
|
ifeq ($(CONFIG_KUNIT_TEST),y)
|
|
obj-$(CONFIG_KUNIT_TEST) += string-stream-test.o
|
|
obj-$(CONFIG_KUNIT_TEST) += assert_test.o
|
|
endif
|
|
|
|
obj-$(CONFIG_KUNIT_EXAMPLE_TEST) += kunit-example-test.o
|