Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/nolibc: integrate with kselftests

Hook up nolibc-test with the kselftests framework.
This enables CI systems and developers to easily execute the tests.

While nolibc-test does not emit KTAP output itself that is not a problem,
as the kselftest executor will wrap the output in KTAP.

Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20250620-nolibc-selftests-v1-4-f6b2ce7c5071@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

+27
+1
tools/testing/selftests/Makefile
··· 77 77 TARGETS += net/packetdrill 78 78 TARGETS += net/rds 79 79 TARGETS += net/tcp_ao 80 + TARGETS += nolibc 80 81 TARGETS += nsfs 81 82 TARGETS += pci_endpoint 82 83 TARGETS += pcie_bwctrl
+26
tools/testing/selftests/nolibc/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + TEST_GEN_PROGS := nolibc-test 4 + 5 + include ../lib.mk 6 + include $(top_srcdir)/scripts/Makefile.compiler 7 + 8 + cc-option = $(call __cc-option, $(CC),,$(1),$(2)) 9 + 10 + include Makefile.include 11 + 12 + CFLAGS = -nostdlib -nostdinc -static \ 13 + -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \ 14 + $(CFLAGS_NOLIBC_TEST) 15 + 16 + ifeq ($(LLVM),) 17 + LDLIBS := -lgcc 18 + endif 19 + 20 + $(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers 21 + 22 + help: 23 + @echo "For the custom nolibc testsuite use '$(MAKE) -f Makefile.nolibc'; available targets:" 24 + @$(MAKE) -f Makefile.nolibc help 25 + 26 + .PHONY: help