aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-01-13 16:09:40 +0100
committerTed Gould <ted@gould.cx>2012-01-13 16:09:40 +0100
commite3ce5513c45374858d9af5ae82ff9a711b6cf2aa (patch)
treebefdb9f53cd8fd29e5bb3db9bace971d9998d7ba /Makefile.am
parent976209fbb36c9b09a59c8d51da80ae065cca8192 (diff)
parentb1aebe568a4f0d0d76e9ea32df47385b26b45c5d (diff)
downloadlibayatana-indicator-e3ce5513c45374858d9af5ae82ff9a711b6cf2aa.tar.gz
libayatana-indicator-e3ce5513c45374858d9af5ae82ff9a711b6cf2aa.tar.bz2
libayatana-indicator-e3ce5513c45374858d9af5ae82ff9a711b6cf2aa.zip
Adding test coverage checking
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 807cad0..182cb2d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,3 +44,38 @@ dist-hook:
echo Failed to generate AUTHORS: not a branch >&2; \
fi
+
+# Coverage targets
+
+.PHONY: clean-gcda
+clean-gcda:
+ @echo Removing old coverage results
+ -find -name '*.gcda' -print | xargs -r rm
+
+.PHONY: coverage-html generate-coverage-html clean-coverage-html
+coverage-html: clean-gcda
+ -$(MAKE) $(AM_MAKEFLAGS) -k check
+ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
+
+generate-coverage-html:
+ @echo Collecting coverage data
+ $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
+ LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
+
+clean-coverage-html: clean-gcda
+ -$(LCOV) --directory $(top_builddir) -z
+ -rm -rf coverage.info coveragereport
+
+.PHONY: coverage-xml generate-coverage-xml clean-coverage-xml
+coverage-xml: clean-gcda
+ -$(MAKE) $(AM_MAKEFLAGS) -k check
+ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-xml
+
+generate-coverage-xml:
+ @echo Generating coverage XML report
+ $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
+
+clean-coverage-xml: clean-gcda
+ -rm -rf $(top_builddir)/coverage.xml
+
+clean-local: clean-coverage-html clean-coverage-xml