Skip to content

Commit

Permalink
ci: Add coverage report
Browse files Browse the repository at this point in the history
We use Coveralls.io, which provides a service integrated with Travis and
GitHub to report coverage data. The coverage report is generated via
gcov and the cpp-coveralls Python module.
  • Loading branch information
ebassi committed Jun 6, 2019
1 parent 0a99a21 commit c5e001f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
@@ -0,0 +1 @@
repo_token: YJi21gyXWjx2BsvS8HRvfwjgXTJaQTqw1
3 changes: 3 additions & 0 deletions .travis-ci/Dockerfile
Expand Up @@ -12,10 +12,13 @@ RUN apt-get update -qq \
python3-pip \
python3-setuptools \
python3-wheel \
python3-yaml \
&& rm -rf /usr/share/doc/* /usr/share/man/*

RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8

ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8

RUN pip3 install meson==0.50.1

RUN pip3 install cpp-coveralls
13 changes: 7 additions & 6 deletions .travis-ci/run-tests.sh
Expand Up @@ -2,13 +2,14 @@

set -x

meson --prefix /usr "$@" _build . || exit $?
builddir="_build"
srcdir=`pwd`

cd _build
CFLAGS='-coverage -ftest-coverage -fprofile-arcs'

ninja || exit $?
meson test || exit $?
meson --prefix /usr "$@" $builddir $srcdir || exit $?

cd ..
ninja -C $builddir || exit $?
meson test -C $builddir || exit $?

rm -rf _build
coveralls -r $builddir -b $builddir -e tests -i src --gcov-options '\-lp'
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -23,4 +23,4 @@ before_script:
- docker build -t withgit .

script:
- docker run withgit /bin/sh -c "CC=$CC sh -x .travis-ci/run-tests.sh"
- docker run withgit /bin/sh -c "CC=$CC CFLAGS=$CFLAGS sh -x .travis-ci/run-tests.sh"

0 comments on commit c5e001f

Please sign in to comment.