]> git.sesse.net Git - movit/commitdiff
Make the COVERAGE variable into an --enable-coverage configure flag.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Mar 2014 00:24:03 +0000 (01:24 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Mar 2014 00:24:03 +0000 (01:24 +0100)
This makes a lot more sense, since it controls compilation options.

Makefile.in
configure.ac

index f88fd5ad05a8c0fa309d91a9738d100b93b10771..fadd3a32200136573f58a8b013cf339032307867 100644 (file)
@@ -8,6 +8,7 @@ datarootdir = @datarootdir@
 datadir = @datadir@
 top_builddir = @top_builddir@
 with_demo_app = @with_demo_app@
+with_coverage = @with_coverage@
 
 CC=@CC@
 CXX=@CXX@
@@ -20,7 +21,7 @@ RANLIB=ranlib
 INSTALL=install
 MKDIR=mkdir
 
-ifeq ($(COVERAGE),1)
+ifeq ($(with_coverage),yes)
 CXXFLAGS += -fprofile-arcs -ftest-coverage --coverage
 LDFLAGS += -fprofile-arcs -ftest-coverage
 LDLIBS += -lgcov
@@ -127,11 +128,16 @@ check: $(TESTS)
                exit 1; \
        fi
 
-# You need to build with COVERAGE=1 to use this target.
+ifeq ($(with_coverage),yes)
 coverage: check
        lcov -d . -c -o movit.info
        lcov --remove movit.info '*_test.cpp' 'test_util.*' 'sandbox_effect.*' widgets.cpp -o movit.info
        genhtml -o coverage movit.info
+else
+coverage:
+       @echo You need to compile with --enable-coverage to use this target.
+       @exit 1
+endif
 
 HDRS = effect_chain.h effect_util.h effect.h input.h image_format.h init.h util.h defs.h resource_pool.h
 HDRS += $(INPUTS:=.h)
index 7515e6def9a1ef36969136ebb98e6d551a003fd5..5e032345d778ddf14b53fe6e0aeb2a241410d8ca 100644 (file)
@@ -19,5 +19,9 @@ PKG_CHECK_MODULES([libpng], [libpng12], [], [with_demo_app=no; AC_MSG_WARN([libp
 
 AC_SUBST([with_demo_app])
 
+with_coverage=no
+AC_ARG_ENABLE([coverage], [  --enable-coverage       build with information needed to compute test coverage], [with_coverage=yes])
+AC_SUBST([with_coverage])
+
 AC_CONFIG_FILES([Makefile movit.pc])
 AC_OUTPUT