on master help sign in
Generate hpc coverage reports.
0dd6f49Bryan O'Sullivan
tests/Makefile+9−3
@@ -9,7 +9,7 @@ lib := ../dist/build/libHStext-$(version).a
9lib-srcs := $(shell grep '^ *Data' ../text.cabal | \
9lib-srcs := $(shell grep '^ *Data' ../text.cabal | \
10 sed -e 's,\.,/,g' -e 's,$$,.hs,')
10 sed -e 's,\.,/,g' -e 's,$$,.hs,')
11
11
12−all: qc qc-hpc
12+all: qc coverage
13
13
14lib: $(lib)
14lib: $(lib)
15
15
@@ -22,9 +22,15 @@ qc: $(lib) QuickCheckUtils.o Properties.o
22
22
23qc-hpc: Properties.hs QuickCheckUtils.hs $(lib-srcs:%=../%)
23qc-hpc: Properties.hs QuickCheckUtils.hs $(lib-srcs:%=../%)
24 -mkdir -p hpcdir
24 -mkdir -p hpcdir
25− rm -f $@.tix
26 $(ghc) $(ghc-hpc-flags) -ihpcdir --make -o $@ $<
25 $(ghc) $(ghc-hpc-flags) -ihpcdir --make -o $@ $<
27
26
27+coverage: qc-hpc-html/hpc_index.html
28+
29+qc-hpc-html/hpc_index.html: qc-hpc
30+ ./qc-hpc
31+ hpc markup qc-hpc --exclude=Main --exclude=Properties \
32+ --exclude=QuickCheckUtils --srcdir=.. --srcdir=. --destdir=$(dir $@)
33+
28%.o: %.hs
34%.o: %.hs
29 $(ghc) $(ghc-flags) -c -o $@ $<
35 $(ghc) $(ghc-flags) -c -o $@ $<
30
36
@@ -38,4 +44,4 @@ text-testdata.tar.bz2:
38 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
44 curl -O http://projects.haskell.org/text/text-testdata.tar.bz2
39
45
40clean:
46clean:
41− -rm -rf *.o *.hi qc qc-hpc hpcdir .hpc
47+ -rm -rf *.o *.hi *.tix qc qc-hpc hpcdir .hpc qc-hpc-html