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