~unity8-desktop-session-team/indicator-session/indicator-session-using-upstart

245.2.1 by Allan LeSage
Added gcov coverage tooling.
1
# Coverage targets
2
3
.PHONY: clean-gcno clean-gcda \
4
	coverage-html generate-coverage-html clean-coverage-html \
5
	coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
6
7
clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
8
9
if HAVE_GCOV
10
11
clean-gcno:
12
	@echo Removing old coverage instrumentation
13
	-find -name '*.gcno' -print | xargs -r rm
14
15
clean-gcda:
16
	@echo Removing old coverage results
17
	-find -name '*.gcda' -print | xargs -r rm
18
  
19
coverage-html: clean-gcda
20
	-$(MAKE) $(AM_MAKEFLAGS) -k check
21
	$(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
22
  
23
generate-coverage-html:
24
	@echo Collecting coverage data
25
	$(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
26
	LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
27
  
28
clean-coverage-html: clean-gcda
29
	-$(LCOV) --directory $(top_builddir) -z
30
	-rm -rf coverage.info coveragereport
31
32
if HAVE_GCOVR
33
34
coverage-gcovr: clean-gcda
35
	-$(MAKE) $(AM_MAKEFLAGS) -k check
36
	$(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
37
	
38
generate-coverage-gcovr:
39
	@echo Generating coverage GCOVR report
40
	$(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
41
	
42
clean-coverage-gcovr: clean-gcda
43
	-rm -rf $(top_builddir)/coverage.xml
44
45
endif # HAVE_GCOVR
46
47
endif # HAVE_GCOV
48