~charlesk/indicator-messages/lp-1493534-fix-null-error-dereference

251.3.1 by Allan LeSage
Made gcovr optional.
1
# Coverage targets
2
3
.PHONY: clean-gcno clean-gcda \
251.3.4 by Allan LeSage
Also cleaning up coverage instrumentation (*.gcno) on clean-local.
4
	coverage-html generate-coverage-html clean-coverage-html \
251.3.3 by Allan LeSage
Consolidated PHONYs.
5
	coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
6
7
clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
251.3.4 by Allan LeSage
Also cleaning up coverage instrumentation (*.gcno) on clean-local.
8
251.3.2 by Allan LeSage
Tested moving PHONY clean targets to top of Makefile.
9
if HAVE_GCOV
251.3.1 by Allan LeSage
Made gcovr optional.
10
11
clean-gcno:
251.3.4 by Allan LeSage
Also cleaning up coverage instrumentation (*.gcno) on clean-local.
12
	@echo Removing old coverage instrumentation
13
	-find -name '*.gcno' -print | xargs -r rm
14
15
clean-gcda:
251.3.1 by Allan LeSage
Made gcovr optional.
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
251.3.6 by Allan LeSage
Pedantic name change for gcovr xml results.
41
	
251.3.1 by Allan LeSage
Made gcovr optional.
42
clean-coverage-gcovr: clean-gcda
43
	-rm -rf $(top_builddir)/coverage.xml
251.3.6 by Allan LeSage
Pedantic name change for gcovr xml results.
44
251.3.1 by Allan LeSage
Made gcovr optional.
45
endif # HAVE_GCOVR
46
47
endif # HAVE_GCOV
48