[telepathy-mission-control/refs/tags/5.0.beta64] Add optional Lcov machinery from telepathy-gabble (usage: make lcov-check)

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Mar 25 10:33:04 PDT 2009


---
 .gitignore        |    5 +++++
 Makefile.am       |    2 ++
 tools/Makefile.am |    1 +
 tools/lcov.am     |   25 +++++++++++++++++++++++++
 4 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100644 tools/lcov.am

diff --git a/.gitignore b/.gitignore
index b666c79..57f5e60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,8 @@
 *.stamp
 *.pyc
 *.bak
+*.gcda
+*.gcno
 /doc/reference/*/html
 /doc/reference/*/xml
 /doc/reference/*/*-decl-list.txt
@@ -46,6 +48,9 @@ examples/mc-example-2
 examples/mc-example-3
 gtk-doc.make
 install-sh
+/lcov.html
+/lcov.info
+/lcov.info.tmp
 libmcclient.pc
 libmcclient/diff
 libmissioncontrol.pc
diff --git a/Makefile.am b/Makefile.am
index ff39fb9..5530e4f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,3 +19,5 @@ pkgconfig_DATA += libmissioncontrol.pc
 endif
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
+include tools/lcov.am
diff --git a/tools/Makefile.am b/tools/Makefile.am
index a5bf95d..d7aa53e 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -12,6 +12,7 @@ EXTRA_DIST = \
     glib-signals-marshal-gen.py \
     gquark-gen.py \
     identity.xsl \
+    lcov.am \
     libtpcodegen.py \
     libglibcodegen.py \
     spec-to-introspect.xsl
diff --git a/tools/lcov.am b/tools/lcov.am
new file mode 100644
index 0000000..1455f83
--- /dev/null
+++ b/tools/lcov.am
@@ -0,0 +1,25 @@
+lcov-reset:
+	lcov --directory @top_srcdir@ --zerocounters
+
+lcov-report:
+	lcov --directory @top_srcdir@ --capture \
+		--output-file @top_builddir@/lcov.info.tmp
+	lcov --directory @top_srcdir@ --output-file @top_builddir@/lcov.info \
+		--remove @top_builddir@/lcov.info.tmp \
+		'doc/reference/*/*-scan.c'
+	rm @top_builddir@/lcov.info.tmp
+	$(mkdir_p) @top_builddir@/lcov.html
+	git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
+	genhtml --title "@PACKAGE_STRING@ $$git_commit" \
+		--output-directory @top_builddir@/lcov.html lcov.info
+	@echo
+	@echo 'lcov report can be found in:'
+	@echo 'file://@abs_top_builddir@/lcov.html/index.html'
+	@echo
+
+lcov-check:
+	$(MAKE) lcov-reset
+	$(MAKE) check
+	$(MAKE) lcov-report
+
+## vim:set ft=automake:
-- 
1.5.6.5




More information about the telepathy-commits mailing list