From 99601a84951ac0ef9782889540fe99b7851fc4ae Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 12 Oct 2019 22:34:23 +0100 Subject: [PATCH] test: Makefile rune for `check' Signed-off-by: Ian Jackson --- .gitignore | 1 + test/Makefile.in | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index c503467..6b938a1 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ test-example/bogus-setup-request build-stamp test/tmp +test/d-* test/udp-preload.so diff --git a/test/Makefile.in b/test/Makefile.in index 0f92038..4eb2ea7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -3,6 +3,9 @@ CC:=@CC@ TARGETS=udp-preload.so +TESTSCRIPTS ?= $(shell echo t-*[0-9a-z]) +TESTNAMES := $(patsubst t-%,%,$(notdir $(TESTSCRIPTS))) + all: $(TARGETS) CFLAGS += -D_REENTRANT -fPIC @@ -10,6 +13,13 @@ CFLAGS += -D_REENTRANT -fPIC udp-preload.so: udp-preload.o $(CC) -shared -Wl,-soname,$@.1 $^ -o $@ -ldl +check: $(foreach t,$(TESTNAMES),d-$t/ok) + +d-%/ok: t-% udp-preload.so common.tcl ../secnet + @rm -rf d-$*; mkdir d-$* + @cd .. && test/$< >test/d-$*/log 2>&1 + @printf "$* " + clean: $(RM) -f *.o *.so $(RM) -rf tmp -- 2.30.2