summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2025-06-20 23:39:33 +0200
committerThomas Weißschuh <linux@weissschuh.net>2025-06-23 22:56:21 +0200
commiteb135311083100b6590a7545618cd9760d896a86 (patch)
tree0ae75415ba8b153f033e5c1f7a4ffeff882c3b50
parent3adf4f90c9bda3d875ce05721ee4bb91c552faa5 (diff)
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>
-rw-r--r--tools/testing/selftests/Makefile1
-rw-r--r--tools/testing/selftests/nolibc/Makefile26
2 files changed, 27 insertions, 0 deletions
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 339b31e6a6b5..3a4c98102f69 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -77,6 +77,7 @@ TARGETS += net/ovpn
TARGETS += net/packetdrill
TARGETS += net/rds
TARGETS += net/tcp_ao
+TARGETS += nolibc
TARGETS += nsfs
TARGETS += pci_endpoint
TARGETS += pcie_bwctrl
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
new file mode 100644
index 000000000000..40f5c2908dda
--- /dev/null
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: GPL-2.0
+
+TEST_GEN_PROGS := nolibc-test
+
+include ../lib.mk
+include $(top_srcdir)/scripts/Makefile.compiler
+
+cc-option = $(call __cc-option, $(CC),,$(1),$(2))
+
+include Makefile.include
+
+CFLAGS = -nostdlib -nostdinc -static \
+ -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
+ $(CFLAGS_NOLIBC_TEST)
+
+ifeq ($(LLVM),)
+LDLIBS := -lgcc
+endif
+
+$(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
+
+help:
+ @echo "For the custom nolibc testsuite use '$(MAKE) -f Makefile.nolibc'; available targets:"
+ @$(MAKE) -f Makefile.nolibc help
+
+.PHONY: help