Debian Codegraph @

tests/Makefile

raw
1 ifeq ($(COVERAGE), 1)
2 ifeq ($(COVER_DB),)
3 export COVER_DB := $(shell echo `pwd`/cover_db)
4 export PYCOV_DB := $(shell echo `pwd`/pycov.dat)
5 export HTML_RPT := $(shell echo `pwd`/lcov_coverage)
6 endif
7 endif
8
9 .PHONY: report
10
11 all: check report
12
13 include common.mak
14
15 TESTS := genhtml lcov gendiffcov llvm2lcov py2lcov perl2lcov xml2lcov
16
17 # there may or may not be some .info files generated for exported
18 # tools - py2lcov, perl2lcov, etc. We want them included in the
19 # report - but they might not have been generated, so we need to
20 # ignore the potential 'empty glob pattern' error message and a
21 # potential remote repo timestamp issue
22 report:
23 $(SPREADSHEET_TOOL) -o report.xlsx `find . -name "*.json"`
24 if [ "x$(COVERAGE)" != 'x' ] ; then \
25 cover $(COVER_DB) ; \
26 $(BINDIR)/perl2lcov -o perlcov.info $(COVER_DB) \
27 --version-script $(VERSION_SCRIPT) \
28 --exclude genError.pm --exclude filter.pl \
29 --exclude brokenCallback.pm --exclude MsgContext.pm \
30 --omit-lines 'ERROR_INTERNAL' --omit-lines '\bdie\b' \
31 --ignore unsupported,unused,inconsistent \
32 --filter region ; \
33 if [ -f $(PYCOV_DB) ] ; then \
34 $(BINDIR)/py2lcov -o pycov.info $(PYCOV_DB) \
35 --version-script $(VERSION_SCRIPT) ; \
36 fi ; \
37 $(BINDIR)/genhtml --parallel -o $(HTML_RPT) \
38 perlcov.info pycov.info \
39 --save --title 'LCOV regression tests' \
40 --show-navigation --flat --branch --show-proportion \
41 --version-script $(VERSION_SCRIPT) \
42 --annotate-script $(ANNOTATE_SCRIPT) \
43 --filter region \
44 --ignore empty,inconsistent ; \
45 cp p*cov.info $(HTML_RPT) ; \
46 echo "Wrote HTML report to ${HTML_RPT}" ; \
47 fi
48
49 clean:
50 rm -rf *.info *.counts test.log src report.xlsx \
51 $(COVER_DB) $(HTML_RPT) $(PYCOV_DB)