[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250620-nolibc-selftests-v1-4-f6b2ce7c5071@weissschuh.net>
Date: Fri, 20 Jun 2025 23:39:33 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Willy Tarreau <w@....eu>, Shuah Khan <shuah@...nel.org>
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
Mark Brown <broonie@...nel.org>,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH 4/4] 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.
Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/nolibc/Makefile | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 339b31e6a6b592217eca1c03068f21728ea024b4..3a4c98102f6967c4a1586104a560418292b3f31d 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 0000000000000000000000000000000000000000..fc7a65ca5fdd77576be49d6227939ec5451a814a
--- /dev/null
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -0,0 +1,20 @@
+# 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
--
2.50.0
Powered by blists - more mailing lists