Ready to ship 2.8
[super-star-trek.git] / test / Makefile
1 # Test-suite makefile for sst
2
3 all:
4         @$(MAKE) regress | ./tapview
5
6 .SUFFIXES: .log .chk
7
8 .log.chk:
9         ../sst -r $< >$@ 2>&1
10
11 TESTLOADS := $(shell ls *.log | sed '/.log/s///')
12 rebuild:
13         @for test in $(TESTLOADS); do \
14             if [ ! -f $${test}.tst ] ; \
15     then \
16                     echo "Remaking $${test}.chk"; \
17                     rm -f $${test}.chk && ../sst -r $${test}.log >$${test}.chk 2>&1; \
18             fi \
19         done
20 regress:
21         @echo "1..$$(ls *.log | wc -l)"
22         @for test in $(TESTLOADS); \
23         do \
24             if [ ! -f $${test}.tst ] ; \
25             then \
26                 legend=$$(sed -n -e '/# Test/s//Test/p' <$${test}.log); \
27                 ../sst -r "$${test}.log" | ./tapdiffer "$${legend}" "$${test}.chk"; \
28             fi \
29         done
30         @rm -f /tmp/regress
31
32 coverage:
33         @coverage erase
34         @for test in $(TESTLOADS); \
35         do \
36             if [ ! -f $${test}.tst ] ; \
37             then \
38                 coverage run -a ../sst -r "$${test}.log" >/dev/null; \
39             fi \
40         done
41         @coverage html
42
43 clean:
44         rm -f .coverage htmlcov/index.html