chiark / gitweb /
Finalise 0.6.2
[secnet.git] / test-common.sd.mk
1 # This file is part of secnet.
2 # See LICENCE and this file CREDITS for full list of copyright holders.
3 # SPDX-License-Identifier: GPL-3.0-or-later
4 # There is NO WARRANTY.
5
6 include common.make
7
8 &TESTSCRIPTS ?= $(wildcard &^/t-[a-z]*[0-9a-z])
9 ifneq ($(OLD_SECNET_DIR),)
10 &TESTSCRIPTS += $(wildcard &^/t-C*[0-9a-z])
11 endif
12
13 &TESTNAMES := $(patsubst t-%,%,$(notdir $(&TESTSCRIPTS)))
14
15 &DEPS += $(src)/test-common.tcl
16 &DEPS += common.make
17 &DEPS += $(src)/test-common.sd.mk
18 &DEPS += &/Dir.mk
19
20 &check-real: $(foreach t,$(&TESTNAMES),&d-$t/ok)
21
22 RECHECK_RM += &d-*
23
24 CHECK_SILENT ?= @
25
26 &d-%/ok: &^/t-% $(&DEPS)
27         $(CHECK_SILENT) rm -rf &d-$*; mkdir &d-$*
28         $(CHECK_SILENT) export SECNET_TEST_BUILDDIR=$(topbuilddir); \
29          export PYTHONBYTECODEBASE=/dev/null; \
30          cd $(src) && \
31          &/t-$* >$(topbuilddir)/&/d-$*/log 2>&\&1 \
32          || { cat $(topbuilddir)/&/d-$*/log >&\&2; false; }
33         $(CHECK_SILENT) printf "&/$* "
34         $(CHECK_SILENT) touch $@
35
36 &CLEAN += & *.so
37
38 &clean::
39         $(RM) -rf & tmp
40         $(RM) -rf & d-*