chiark / gitweb /
test-common: Cope if argv0 starts with ./
[secnet.git] / test-common.make.in
1
2 include ../common.make
3
4 TESTSCRIPTS ?= $(shell echo $(srcdir)/t-*[0-9a-z])
5 TESTNAMES := $(patsubst t-%,%,$(notdir $(TESTSCRIPTS)))
6
7 DEPS += $(topdir)/test-common.tcl
8 DEPS += $(topdir)/common.make
9 DEPS += $(topdir)/test-common.make
10 DEPS += Makefile
11
12 TARGETS += check
13
14 export PYTHONBYTECODEBASE=/dev/null
15
16 all: $(TARGETS)
17
18 check-real: $(foreach t,$(TESTNAMES),d-$t/ok)
19
20 d-%/ok: $(srcdir)/t-% $(DEPS)
21         @rm -rf d-$*; mkdir d-$*
22         @export SECNET_TEST_BUILDDIR=$(topbuilddir); \
23          cd $(topdir) && \
24          $(TESTDIR)/t-$* >$(topbuilddir)/$(TESTDIR)/d-$*/log 2>&1 \
25          || { cat $(topbuilddir)/$(TESTDIR)/d-$*/log >&2; false; }
26         @printf "$(TESTDIR)/$* "
27         @touch $@
28
29 clean:
30         $(RM) -f *.o *.so
31         $(RM) -rf tmp
32         $(RM) -rf d-*