chiark / gitweb /
site: promote creation of st->scratch
[secnet.git] / test-common.sd.mk
1
2 include common.make
3
4 &TESTSCRIPTS ?= $(wildcard &^/t-[a-z]*[0-9a-z])
5 ifneq ($(OLD_SECNET_DIR),)
6 &TESTSCRIPTS += $(wildcard &^/t-C*[0-9a-z])
7 endif
8
9 &TESTNAMES := $(patsubst t-%,%,$(notdir $(&TESTSCRIPTS)))
10
11 &DEPS += $(src)/test-common.tcl
12 &DEPS += common.make
13 &DEPS += $(src)/test-common.sd.mk
14 &DEPS += &/Dir.mk
15
16 &check-real: $(foreach t,$(&TESTNAMES),&d-$t/ok)
17
18 RECHECK_RM += &d-*
19
20 CHECK_SILENT ?= @
21
22 &d-%/ok: &^/t-% $(&DEPS)
23         $(CHECK_SILENT) rm -rf &d-$*; mkdir &d-$*
24         $(CHECK_SILENT) export SECNET_TEST_BUILDDIR=$(topbuilddir); \
25          export PYTHONBYTECODEBASE=/dev/null; \
26          cd $(src) && \
27          &/t-$* >$(topbuilddir)/&/d-$*/log 2>&\&1 \
28          || { cat $(topbuilddir)/&/d-$*/log >&\&2; false; }
29         $(CHECK_SILENT) printf "&/$* "
30         $(CHECK_SILENT) touch $@
31
32 &CLEAN += & *.so
33
34 &clean::
35         $(RM) -rf & tmp
36         $(RM) -rf & d-*