summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-09-27 17:45:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-09-27 17:46:15 +0100
commitd837a458b95c0e1866eecaf3688dfa36e7dafe8e (patch)
treed15952cf3e26b5f20f99cf7bc82d7cb2c1912c44
parentabe1b89da4a2aa255a218103c7a05711d0f73b1c (diff)
[configure] Work-around bad interaction of libtool and lcov
libtool causes the .gcda files to be generated in the .libs/ directory, separate from the .c source file. lcov expects them to be in the same directory - so massage the lcov.info file to remove the reference to the .libs/. Also separate the target for generating the lcov output, so that it can be run independently from triggering the tests. And improve convenience of using the other lcov targets.
-rw-r--r--Makefile.am29
1 files changed, 20 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index 0ec24043..5f3ddfd9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,17 +22,28 @@ check-valgrind: all
cd perf && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
perf: all
cd perf && $(MAKE) $(AM_MAKEFLAGS) perf
-lcov: check
- $(LTP) --directory $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_TEST --no-checksum
- LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-test-lcov --title "Cairo Test Code Coverage" --show-details cairo-test-lcov.info
-lcov-perf: perf
- $(LTP) --directory $(top_builddir) --capture --output-file cairo-perf-lcov.info --test-name CAIRO_PERF --no-checksum
- LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-perf-lcov --title "Cairo Perf Code Coverage" --show-details cairo-perf-lcov.info
+
+.PHONY: lcov lcov-perf genlcov lcov-clean
+# use recursive makes in order to ignore errors during check/perf
+lcov:
+ -$(MAKE) $(AM_MAKEFLAGS) check
+ $(MAKE) $(AM_MAKEFLAGS) genlcov
+lcov-perf:
+ -$(MAKE) $(AM_MAKEFLAGS) perf
+ $(MAKE) $(AM_MAKEFLAGS) genlcov
+
+# we have to massage the lcov.info file slightly to hide the effect of libtool
+# placing the objects files in the .libs/ directory separate from the *.c
+genlcov:
+ $(LTP) --directory $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_PERF --no-checksum
+ $(SED) -e 's#.libs/##' < cairo-lcov.info > cairo-lcov.info.tmp
+ LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-lcov --title "Cairo Code Coverage" --show-details cairo-lcov.info.tmp
+ rm -f cairo-lcov.info.tmp
+
lcov-clean:
$(LTP) --directory $(top_builddir) --reset
- $(RM) -rf \
- cairo-test-lcov.info cairo-test-lcov \
- cairo-perf-lcov.info cairo-perf-lcov
+ $(RM) -rf cairo-lcov.info cairo-lcov
+ $(FIND) -name '*.gcda' -print0 | xargs -0 rm
EXTRA_DIST = \
AUTHORS \