Forward pror to Python achieved, still runs under 2.
[super-star-trek.git] / test / Makefile
1 # Test-suite makefile for sst
2
3 PYTHON=python
4
5 all:
6         @echo "With Python 2:"
7         @make -e PYTHON=python2 regress
8         @echo "With Python 3:"
9         @make -e PYTHON=python3 regress
10         @echo "No diff output is good news."
11
12 .SUFFIXES: .log .chk
13
14 .log.chk:
15         ../sst.py -r $< >$@ 2>&1
16
17 TESTLOADS := $(shell ls *.log | sed '/.log/s///')
18 buildregress:
19         @for test in $(TESTLOADS); do \
20             if [ ! -f $${test}.tst ] ; \
21             then \
22                     echo "Remaking $${test}.chk"; \
23                     rm -f $${test}.chk && ../sst.py -r $${test}.log >$${test}.chk 2>&1; \
24             fi \
25         done
26 regress:
27         @for test in $(TESTLOADS); \
28         do \
29             if [ ! -f $${test}.tst ] ; \
30             then \
31                 (if echo -n "$${test}: " >&2; grep 'Test' $${test}.log >&2;\
32                 $(PYTHON) ../sst.py -r $${test}.log >/tmp/regress 2>&1; \
33                 then diff -u $${test}.chk /tmp/regress; \
34                 else echo "*** Nonzero return status on $${test}!"; exit 1; fi;) \
35             fi \
36         done
37         @rm -f /tmp/regress