summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-12-11 11:01:25 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-12-12 12:24:10 -0200
commit6a56b171b6c4a8bdc3db47ce5b9627db68ac468b (patch)
tree96c443ae9ee91af93be211cf26fc4004a41b7b79 /Makefile.am
parentb1b312d4ec0ec4123e96ddb2719933120a09ea00 (diff)
downloadbluez-6a56b171b6c4a8bdc3db47ce5b9627db68ac468b.tar.gz
build: Add coverage support
Coverage is enabled with --enable-maintainer-mode, 2 new targets are added 'coverage' and 'clean-coverage', the first generate the reports using lcov and depend on the second to cleanup previous generated reports and .gcda files.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am20
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index d6cd8870c..f2b22ae80 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -442,5 +442,25 @@ lib/bluetooth/%.h: lib/%.h
$(AM_V_at)$(MKDIR_P) lib/bluetooth
$(AM_V_GEN)$(LN_S) -f "$(abs_top_builddir)"/$< $@
+if COVERAGE
+clean-coverage:
+ @lcov --directory $(top_builddir) --zerocounters
+ $(RM) -r coverage $(top_builddir)/coverage.info
+
+coverage: check
+ @lcov --compat-libtool --directory $(top_builddir) --capture \
+ --output-file $(top_builddir)/coverage.info
+ $(AM_V_at)$(MKDIR_P) coverage
+ @genhtml -o coverage/ $(top_builddir)/coverage.info
+
+clean-local: clean-coverage
+ -find $(top_builddir) -name "*.gcno" -delete
+ -find $(top_builddir) -name "*.gcda" -delete
+ $(RM) -r lib/bluetooth
+
+else
clean-local:
+ -find $(top_builddir) -name "*.gcno" -delete
+ -find $(top_builddir) -name "*.gcda" -delete
$(RM) -r lib/bluetooth
+endif