summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-05 23:19:59 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-06 00:19:40 -0400
commit8330ed133c521418af9695b833697f8f48b789ff (patch)
tree608a2fa0997b9a62f5272a76853b01b5fd68c146 /Makefile.am
parentbb4f8d75af0a08b1e5262986a75042874da29850 (diff)
downloaddconf-8330ed133c521418af9695b833697f8f48b789ff.tar.gz
Add support for measuring testcase coverage
You need to ./configure with --enable-gcov and then type 'make lcov'. HTML report goes into ./lcov-html/index.html
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index a30c0de..6f243f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,3 +9,24 @@ SUBDIRS += editor
endif
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
+.PHONY: lcov lcov-clean
+# use recursive makes in order to ignore errors during check
+lcov:
+ -$(MAKE) $(AM_MAKEFLAGS) lcov-clean
+ -$(MAKE) $(AM_MAKEFLAGS) -k check
+ lcov --directory $(top_builddir) --capture --output-file dconf-lcov.info --test-name dconf --no-checksum --compat-libtool
+ LANG=C genhtml --prefix $(top_builddir) --output-directory lcov-html --legend --show-details dconf-lcov.info
+ @echo
+ @echo " file://$(abs_top_builddir)/lcov-html/index.html"
+ @echo
+
+clean-am: lcov-clean gcno-clean
+
+gcno-clean:
+ -find -name '*.gcno' -exec rm -f '{}' ';'
+
+lcov-clean:
+ -lcov --directory $(top_builddir) -z
+ -find -name '*.gcda' -exec rm -f '{}' ';'
+ rm -rf lcov-html dconf-lcov.info