chiark / gitweb /
test: Makefile rune for `check'
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Oct 2019 21:34:23 +0000 (22:34 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Oct 2019 22:29:26 +0000 (23:29 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
test/Makefile.in

index c503467..6b938a1 100644 (file)
@@ -38,4 +38,5 @@ test-example/bogus-setup-request
 build-stamp
 
 test/tmp
+test/d-*
 test/udp-preload.so
index 0f92038..4eb2ea7 100644 (file)
@@ -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