improve Makefile for getting test-data
[packages/text.git] / tests / Makefile
1 VCS = hg
2 count = 1000
3
4 all: coverage literal-rule-test
5
6 literal-rule-test:
7 ./literal-rule-test.sh
8
9 coverage: build coverage/hpc_index.html
10
11 build: text-test-data
12 cabal configure -fhpc
13 cabal build
14
15 text-test-data:
16 ifeq ($(VCS),git)
17 git clone https://github.com/bos/text-test-data.git
18 else
19 hg clone https://bitbucket.org/bos/text-test-data
20 endif
21 $(MAKE) -C text-test-data
22
23 coverage/text-tests.tix:
24 -mkdir -p coverage
25 ./dist/build/text-tests/text-tests -a $(count)
26 mv text-tests.tix $@
27
28 coverage/text-tests-stdio.tix:
29 -mkdir -p coverage
30 ./scripts/cover-stdio.sh ./dist/build/text-tests-stdio/text-tests-stdio
31 mv text-tests-stdio.tix $@
32
33 coverage/coverage.tix: coverage/text-tests.tix coverage/text-tests-stdio.tix
34 hpc combine --output=$@ \
35 --exclude=Main \
36 coverage/text-tests.tix \
37 coverage/text-tests-stdio.tix
38
39 coverage/hpc_index.html: coverage/coverage.tix
40 hpc markup --destdir=coverage coverage/coverage.tix
41
42 clean:
43 rm -rf dist coverage .hpc
44
45 .PHONY: all build clean coverage literal-rule-test