From: Ian Jackson Date: Sat, 12 Oct 2019 21:34:23 +0000 (+0100) Subject: test: Makefile rune for `check' X-Git-Tag: v0.5.0~93 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=commitdiff_plain;h=99601a84951ac0ef9782889540fe99b7851fc4ae;hp=dce79707165d23a0125582e5748f78e145901b2b test: Makefile rune for `check' Signed-off-by: Ian Jackson --- 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