summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2009-01-16 10:47:39 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2009-01-20 17:57:37 +0000
commitfb8a53ca392f276739a92de0b88727b262c7cca9 (patch)
tree63833a0bf17a839d24adb6767172449914b32c9c
parente9617286b23c53c21391640b329dd28352f20dff (diff)
Add LCOV machinery
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am1
-rw-r--r--tools/Makefile.am1
-rw-r--r--tools/lcov.am24
4 files changed, 30 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 914c481bb..dc23715e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
*.[ao]
+*.gcda
+*.gcno
*.l[ao]
*.loT
*.orig
@@ -36,6 +38,8 @@ core
/extensions/extensions.html
/gtk-doc.make
/install-sh
+/lcov.html
+/lcov.info
/libtool
/lib/gibber/gibber-signals-marshal.c
/lib/gibber/gibber-signals-marshal.h
diff --git a/Makefile.am b/Makefile.am
index 757255413..8fb5722ff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,4 +9,5 @@ check-twisted: all
check-all: check check-twisted
+include tools/lcov.am
include tools/telepathy.am
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 99cd2a025..f61a9f4c2 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -10,6 +10,7 @@ EXTRA_DIST = \
glib-interfaces-gen.py \
glib-signals-marshal-gen.py \
identity.xsl \
+ lcov.am \
libglibcodegen.py \
libtpcodegen.py \
telepathy.am \
diff --git a/tools/lcov.am b/tools/lcov.am
new file mode 100644
index 000000000..494eea0fe
--- /dev/null
+++ b/tools/lcov.am
@@ -0,0 +1,24 @@
+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 telepathy-glib-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: