Skip to content

Commit

Permalink
Travis: attempt gcov build
Browse files Browse the repository at this point in the history
  • Loading branch information
nicowilliams committed May 28, 2017
1 parent f5660e8 commit de7a191
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .travis.yml
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions Makefile.am
Expand Up @@ -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

4 changes: 4 additions & 0 deletions cf/Makefile.am.common
Expand Up @@ -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
6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -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
Expand Down

0 comments on commit de7a191

Please sign in to comment.