check.mak: enable lcov on individual tests
authorAlexander Schrab <alexas@axis.com>
Fri, 22 Feb 2013 12:19:56 +0000 (13:19 +0100)
committerTim-Philipp Müller <tim@centricular.net>
Mon, 25 Feb 2013 10:12:40 +0000 (10:12 +0000)
Adds support for make elements/queue.lcov

https://bugzilla.gnome.org/show_bug.cgi?id=694442

check.mak
coverage/lcov.mak

index 0aec843..0665d63 100644 (file)
--- 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
index fc1f6b2..b45728a 100644 (file)
@@ -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