blob: 43c53a9b2b2d498d70d61f00202281ef6f7c3717 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libtap src tests samples doc man patches
code_coverage_quiet = --quiet
check-code-coverage:
if CODE_COVERAGE_ENABLED
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
$(MAKE) $(AM_MAKEFLAGS) code-coverage-html
else
@echo "You need to run configure with --enable-code-coverage to enable code coverage"
endif
code-coverage-capture:
if CODE_COVERAGE_ENABLED
$(LCOV) $(code_coverage_quiet) \
--directory $(top_builddir)/src/common \
--directory $(top_builddir)/src/knot \
--directory $(top_builddir)/src/libknot \
--capture \
--ignore-errors source \
--base-directory $(top_builddir)/src \
--output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-src_capture.info" \
--test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
--no-checksum --compat-libtool
$(LCOV) $(code_coverage_quiet) \
--directory $(top_builddir)/src/knot/conf \
--capture \
--ignore-errors source \
--base-directory $(top_builddir)/src/knot/conf \
--output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-conf_capture.info" \
--test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
--no-checksum --compat-libtool
$(LCOV) $(code_coverage_quiet) \
--directory $(top_builddir)/src/zscanner \
--capture \
--ignore-errors source \
--base-directory $(top_builddir)/src/zscanner \
--output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-zscanner_capture.info" \
--test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
--no-checksum --compat-libtool
$(LCOV) $(code_coverage_quiet) \
--add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-src_capture.info" \
--add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-conf_capture.info" \
--add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-zscanner_capture.info" \
--output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info"
-@rm -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_base.info $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_capture.info
else
@echo "You need to run configure with --enable-code-coverage to enable code coverage"
endif
code-coverage-html:
if CODE_COVERAGE_ENABLED
@echo "Generating code coverage HTML report (this might take a while)"
@cp src/knot/conf/cf-lex.l src/knot/conf/cf-parse.y src/
LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(top_builddir) --output-directory "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info" --ignore-errors source
-@rm src/cf-lex.l src/cf-parse.y
else
@echo "You need to run configure with --enable-code-coverage to enable code coverage"
endif
if CODE_COVERAGE_ENABLED
clean-local: code-coverage-clean
code-coverage-clean:
-$(LCOV) --directory $(top_builddir) -z
-rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_base.info \
$(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_coverage.info \
$(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage/
-find . -name "*.gcda" -o -name "*.gcov" -delete
endif
DISTCHECK_CONFIGURE_FLAGS = --without-ragel --disable-code-coverage
.PHONY: check-code-coverage code-coverage-initial code-coverage-capture code-coverage-html code-coverage-clean
|