]> code.delx.au - pulseaudio/commitdiff
build: add a target to ease the creation of coverage files
authorDeng Zhengrong <dzrongg@gmail.com>
Fri, 20 Jul 2012 06:32:35 +0000 (14:32 +0800)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Sat, 4 Aug 2012 06:23:35 +0000 (08:23 +0200)
src/Makefile.am

index 46309a16bc54d44be3bd9a7cb39f34de7fd6aab0..0957fb9cca092e6cf2f24676886b2905c0423dea 100644 (file)
@@ -2066,4 +2066,22 @@ $(installmodlibexecLTLIBRARIES): install-pkglibLTLIBRARIES
 installpadsplibLTLIBRARIES = install-padsplibLTLIBRARIES
 $(installpadsplibLTLIBRARIES): install-libLTLIBRARIES
 
-.PHONY: massif update-all update-ffmpeg update-sbc update-map-file
+if HAVE_GCOV
+coverage:
+       @echo ""
+       @echo "Don't forget to run 'make check' before generating coverage stats."
+       @echo ""
+       lcov --capture --directory . --output-file $(builddir)/gcov-all.info
+       -rm -r $(builddir)/coverage
+       genhtml --output-directory $(builddir)/coverage gcov-all.info
+       @echo ""
+       @echo "Coverage data now available at: $(abs_builddir)/coverage/index.html"
+else
+coverage:
+       @echo ""
+       @echo "To generate coverage stats, rerun configure with '--enable-gcov',"
+       @echo "and don't forget to disable it again for regular builds."
+       @echo ""
+endif
+
+.PHONY: massif update-all update-ffmpeg update-sbc update-map-file coverage