Add a coverage target to the Makefile.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Oct 2012 21:02:51 +0000 (23:02 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Oct 2012 21:02:51 +0000 (23:02 +0200)
.gitignore
Makefile

index b79e6d3..c2bc3d4 100644 (file)
@@ -22,3 +22,5 @@ white_balance_effect_test
 lift_gamma_gain_effect_test
 flat_input_test
 chain-*.frag
+movit.info
+coverage/
index d068f6c..026fcb8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -111,6 +111,7 @@ DEPS=$(OBJS:.o=.d)
 
 clean:
        $(RM) demo $(TESTS) libmovit.a $(OBJS) $(OBJS:.o=.gcno) $(OBJS:.o=.gcda) $(DEPS) step-*.dot
+       $(RM) -r movit.info coverage/
 
 check: $(TESTS)
        FAIL=0; \
@@ -119,4 +120,10 @@ check: $(TESTS)
        done; \
        exit $$FAIL
 
-.PHONY: clean check all
+# You need to build with COVERAGE=1 to use this target.
+coverage: check
+       lcov -d . -c -o movit.info
+       lcov --remove movit.info '*_test.cpp' '*/test_util.{cpp,h}' -o movit.info
+       genhtml -o coverage movit.info
+
+.PHONY: coverage clean check all