~online-accounts/libaccounts-glib/packaging

« back to all changes in this revision

Viewing changes to Makefile.am.coverage

Add coverage reporting using lcov

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Coverage targets
 
3
 
 
4
if HAVE_GCOV
 
5
 
 
6
.PHONY: clean-gcda
 
7
clean-gcda:
 
8
        @echo Removing old coverage results
 
9
        -$(AM_V_at)find -name '*.gcda' -print | xargs -r rm
 
10
 
 
11
.PHONY: coverage-html generate-coverage-html clean-coverage-html
 
12
coverage-html: clean-gcda
 
13
        -$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
 
14
        $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
 
15
 
 
16
generate-coverage-html:
 
17
        @echo Collecting coverage data
 
18
        $(AM_V_at)$(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
 
19
        $(AM_V_at)LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
 
20
 
 
21
clean-coverage-html: clean-gcda
 
22
        -$(AM_V_at)$(LCOV) --directory $(top_builddir) -z
 
23
        -$(AM_V_at)rm -rf coverage.info coveragereport
 
24
 
 
25
clean-local: clean-coverage-html
 
26
 
 
27
endif # HAVE_GCOV