Travis: attempt gcov build
authorNicolas Williams <nico@twosigma.com>
Sun, 28 May 2017 20:19:05 +0000 (15:19 -0500)
committerNicolas Williams <nico@twosigma.com>
Sun, 28 May 2017 21:58:39 +0000 (16:58 -0500)
.travis.yml
Makefile.am
cf/Makefile.am.common
configure.ac

index 9fee851786ae644d5700c3f59baa2efd360a35ab..02343e4ca9429594a5aeaffc02b381856ce20199 100644 (file)
@@ -13,13 +13,28 @@ before_install:
 
 install:
     - cd ci-build
-    - ../configure --enable-maintainer-mode
+    - if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
+    - ../configure --enable-maintainer-mode $COVERAGE
     - make -j3
 
 script:
     - if [ x${COVERITY_SCAN_BRANCH} != x1 ]; then make check; fi
 
 compiler: clang
+after_script:
+    - if [ -n "$COVERAGE" ]; then coveralls --gcov-options; fi
+
+matrix:
+    # Add a gcov build
+    include:
+        - compiler: gcc
+          env: COVERAGE="--enable-gcov"
+          os: linux
+    # The gcov build is not working quite yet
+    allow_failures:
+        compiler: gcc
+        env: COVERAGE="--enable-gcov"
+        os: linux
 
 notifications:
     email:
index 55417eb635043fe1ba3e6920cc771786f2fcac4b..f2bb5ac116918629e7ece4ca104bd46e7171dcf3 100644 (file)
@@ -64,3 +64,9 @@ EXTRA_DIST = \
 
 print-distdir:
        @echo $(distdir)
+
+clean-local-gcov:
+       find . '(' -name '*.gcno' -o -name '*.gcda' -o -name '*.gcov' ')' -a -print|xargs rm -f
+
+.PHONY: clean-local-gcov
+
index ece1cf5762d07d27ddde86dbc164bf25d38d60fa..de34f69eedf834d763006cff82ca98d1448e58a8 100644 (file)
@@ -293,3 +293,7 @@ distdir-in-tree: $(DISTFILES) $(INFO_DEPS)
 heim_verbose = $(heim_verbose_$(V))
 heim_verbose_ = $(heim_verbose_$(AM_DEFAULT_VERBOSITY))
 heim_verbose_0 = @echo "  GEN    "$@;
+
+if ENABLE_GCOV
+AM_CFLAGS += --coverage --no-inline
+endif
index 01bf32032bea71f664dda9d974c327a1a45e77bb..806b639730585cbcfff8fa9474b0017fdf3375ed 100644 (file)
@@ -72,6 +72,12 @@ AC_C___ATTRIBUTE__
 AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = "yes")
 rk_VERSIONSCRIPT
 
+dnl Code coverage
+AC_ARG_ENABLE([gcov],
+        AC_HELP_STRING([--enable-gcov], [enable gcov code coverage tool]))
+AM_CONDITIONAL([ENABLE_GCOV], [test "x$enable_gcov" = xyes])
+
+
 dnl
 dnl Helper bits for cross compiling
 dnl