on master help sign in
improve Makefile for getting test-data
becdb77Kubo Kovac
tests-and-benchmarks.markdown+7−4
@@ -13,10 +13,13 @@ you can clone from one of the following locations:
13* Git mirror repository:
13* Git mirror repository:
14 [github.com/bos/text-test-data](https://github.com/bos/text-test-data)
14 [github.com/bos/text-test-data](https://github.com/bos/text-test-data)
15
15
16−You should clone that repository into the `tests` subdirectory (your
16+You can clone either repository into the `tests` subdirectory using
17−clone must be named `text-test-data` locally), then run `make -C
17+
18−tests/text-test-data` to uncompress the test files. Many tests and
18+ cd tests/
19+ make text-test-data # to clone from mercurial, OR
20+ make VCS=git text-test-data # to clone from git
21+
19−benchmarks will fail if the test files are missing.
22+Many tests and benchmarks will fail if the test files are missing.
20
23
21Functional tests
24Functional tests
22----------------
25----------------
tests/Makefile+6−1
@@ -1,3 +1,4 @@
1+VCS = hg
1count = 1000
2count = 1000
2
3
3all: coverage literal-rule-test
4all: coverage literal-rule-test
@@ -12,7 +13,11 @@ build: text-test-data
12 cabal build
13 cabal build
13
14
14text-test-data:
15text-test-data:
16+ifeq ($(VCS),git)
17+ git clone https://github.com/bos/text-test-data.git
18+else
15 hg clone https://bitbucket.org/bos/text-test-data
19 hg clone https://bitbucket.org/bos/text-test-data
20+endif
16 $(MAKE) -C text-test-data
21 $(MAKE) -C text-test-data
17
22
18coverage/text-tests.tix:
23coverage/text-tests.tix:
@@ -37,4 +42,4 @@ coverage/hpc_index.html: coverage/coverage.tix
37clean:
42clean:
38 rm -rf dist coverage .hpc
43 rm -rf dist coverage .hpc
39
44
40−.PHONY: build coverage all literal-rule-test
45+.PHONY: all build clean coverage literal-rule-test