Skip to content

Commit

Permalink
Fixed inline coverage, cleaned up CI config
Browse files Browse the repository at this point in the history
This adds a separate gcov job to Travis-CI for generating code coverage. The remaining jobs no longer need to install coveralls dependencies. The gcov job disables inlining to fix coverage of inline functions (broken by -Og).
  • Loading branch information
ludocode committed Apr 8, 2017
1 parent 08b8037 commit 38e8bfc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 26 deletions.
23 changes: 17 additions & 6 deletions .travis.yml
Expand Up @@ -8,12 +8,6 @@ addons:
packages:
- clang
- valgrind
# these packages are needed for urllib3[secure] for SNI support
# (they may not be installed on all Travis build nodes)
- build-essential
- python-dev
- libffi-dev
- libssl-dev

script: tools/ci.sh

Expand All @@ -28,6 +22,23 @@ env:

matrix:
include:

# osx build
- os: osx
compiler: clang
env: "OSX=1"

# code coverage build
- os: linux
compiler: gcov
env: "STANDARD=1"
addons:
apt:
packages:
- valgrind
# these packages are needed for urllib3[secure] for SNI support for
# coveralls integration
- build-essential
- python-dev
- libffi-dev
- libssl-dev
8 changes: 7 additions & 1 deletion SConstruct
Expand Up @@ -87,7 +87,13 @@ else:

gcovflags = []
if ARGUMENTS.get('gcov'):
gcovflags = ["-DMPACK_GCOV=1", "--coverage"]
gcovflags = [
"-DMPACK_GCOV=1",
"--coverage",
"-fno-inline",
"-fno-inline-small-functions",
"-fno-default-inline"
]

ltoflags = ["-O3", "-flto", "-fuse-linker-plugin", "-fno-fat-lto-objects"]

Expand Down
35 changes: 16 additions & 19 deletions tools/ci.sh
Expand Up @@ -5,45 +5,42 @@
# building the amalgamated package, running code coverage, and building
# the Xcode project.

set -e

if [ "$(uname -s)" == "Darwin" ]; then
unset CC
unset CXX
cd projects/xcode
xcodebuild -version
xcodebuild build -configuration Debug || exit $?
xcodebuild build -configuration Release || exit $?
xcodebuild build -configuration Debug
xcodebuild build -configuration Release
echo "Running Debug unit tests..."
( cd ../.. ; projects/xcode/build/Debug/MPack ) || exit $?
( cd ../.. ; projects/xcode/build/Debug/MPack )
echo "Running Release unit tests..."
( cd ../.. ; projects/xcode/build/Release/MPack ) || exit $?
( cd ../.. ; projects/xcode/build/Release/MPack )
exit 0
fi

if [[ "$AMALGAMATED" == "1" ]]; then
tools/amalgamate.sh || exit $?
tools/amalgamate.sh
cd build/amalgamation
fi
pwd

if [[ "$CC" == "scan-build" ]]; then
unset CC
unset CXX
scan-build -o analysis --use-cc=`which clang` --status-bugs scons || exit $?

elif [[ "$CC" == "gcc" ]] && [[ "$STANDARD" == "1" ]]; then
# We only perform code coverage measurements from the
# GCC non-amalgamated build.
scons gcov=1 all=1 || exit $?
tools/gcov.sh || exit $?
pip install --user cpp-coveralls urllib3[secure] || exit $?
scan-build -o analysis --use-cc=`which clang` --status-bugs scons

# Coveralls submission continues to experience random failures:
# {u'message': u"Couldn't find a repository matching this job.", u'error': True}
# For now we'll just ignore it if it fails.
coveralls --no-gcov --include src #|| exit $?
true
elif [[ "$CC" == "gcov" ]]; then
unset CC
unset CXX
scons gcov=1
tools/gcov.sh
pip install --user cpp-coveralls urllib3[secure]
coveralls --no-gcov --include src

else
scons all=1 || exit $?
scons all=1

fi

0 comments on commit 38e8bfc

Please sign in to comment.