Skip to content

Commit eb13531

Browse files
committed
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>
1 parent 3adf4f9 commit eb13531

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

tools/testing/selftests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ TARGETS += net/ovpn
7777
TARGETS += net/packetdrill
7878
TARGETS += net/rds
7979
TARGETS += net/tcp_ao
80+
TARGETS += nolibc
8081
TARGETS += nsfs
8182
TARGETS += pci_endpoint
8283
TARGETS += pcie_bwctrl
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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

0 commit comments

Comments
 (0)