From 0147cc80a657cbe3568b3e7bac8fa78ae4526515 Mon Sep 17 00:00:00 2001 From: Alexander Schrab Date: Fri, 22 Feb 2013 13:19:56 +0100 Subject: [PATCH] check.mak: enable lcov on individual tests Adds support for make elements/queue.lcov https://bugzilla.gnome.org/show_bug.cgi?id=694442 --- check.mak | 25 +++++++++++++++++++++++++ coverage/lcov.mak | 10 +++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/check.mak b/check.mak index 0aec843..0665d63 100644 --- a/check.mak +++ b/check.mak @@ -86,6 +86,31 @@ LOOPS = 10 $(LIBTOOL) --mode=execute \ gdb $* +%.lcov-reset: + $(MAKE) $*.lcov-run + $(MAKE) $*.lcov-report + +%.lcov: % + $(MAKE) $*.lcov-reset + +if GST_GCOV_ENABLED +%.lcov-clean: + $(MAKE) -C $(top_builddir) lcov-clean + +%.lcov-run: + $(MAKE) $*.lcov-clean + $(MAKE) $*.check + +%.lcov-report: + $(MAKE) -C $(top_builddir) lcov-report +else +%.lcov-run: + echo "Need to reconfigure with --enable-gcov" + +%.lcov-report: + echo "Need to reconfigure with --enable-gcov" +endif + # torture tests torture: $(TESTS) -rm test-registry.xml diff --git a/coverage/lcov.mak b/coverage/lcov.mak index fc1f6b2..b45728a 100644 --- a/coverage/lcov.mak +++ b/coverage/lcov.mak @@ -1,5 +1,5 @@ ## .PHONY so it always rebuilds it -.PHONY: lcov-reset lcov lcov-run lcov-report lcov-upload +.PHONY: lcov-reset lcov lcov-run lcov-report lcov-upload lcov-clean # run lcov from scratch, always lcov-reset: @@ -11,10 +11,14 @@ lcov: $(MAKE) lcov-reset if GST_GCOV_ENABLED -# reset run coverage tests -lcov-run: +# reset lcov stats +lcov-clean: @-rm -rf lcov lcov --directory . --zerocounters + +# reset run coverage tests +lcov-run: + -$(MAKE) lcov-clean -if test -d tests/check; then $(MAKE) -C tests/check inspect; fi -$(MAKE) check -- 2.7.4