Skip to content

Commit

Permalink
Add coverage testing to travis matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
r0mai committed Apr 23, 2016
1 parent 18668a7 commit 77514e5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ os:
compiler:
- gcc
- clang
matrix:
include:
- os: linux
compiler: gcc
env: COVERAGE="true"
addons:
apt:
sources:
Expand Down
9 changes: 7 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ then
BUILD_THREADS=1
fi

if [ -z "${BUILD_TYPE}" ]
then
BUILD_TYPE="Release"
fi

PLATFORM="$(tools/detect_platform.sh)"

# Config
Expand All @@ -50,7 +55,7 @@ then
cd templight
mkdir -p build; cd build
cmake ../llvm \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DLLVM_ENABLE_TERMINFO=OFF \
&& make templight -j${BUILD_THREADS}
cd ..
Expand All @@ -75,7 +80,7 @@ mkdir -p bin; cd bin
for t in core pp mdb; do
test/system/app/${t}/metashell_${t}_system_test \
app/metashell/metashell -- "-I$(pwd)/../3rd/boost/include" --

test/system/app/${t}/metashell_${t}_system_test \
app/metashell/metashell \
--engine clang \
Expand Down
19 changes: 18 additions & 1 deletion tools/travis/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if [ "$CXX" == "g++" ]; then
export CXX="g++-4.8";
fi

[ "${COVERAGE}" = "true" ] && sudo pip install cpp-coveralls

# Test that the download version links are correct

git fetch --tags
Expand All @@ -31,7 +33,22 @@ cd ../..

# Test the code

BUILD_THREADS=2 CXXFLAGS=-Werror NO_TEMPLIGHT=1 ./build.sh
export CXXFLAGS="-Werror"

# If we check for coverage, than add an extra compiler flag
[ "${COVERAGE}" = "true" ] && export CXXFLAGS="${CXXFLAGS} --coverage"
[ "${COVERAGE}" = "true" ] && export BUILD_TYPE="Debug"

BUILD_THREADS=2 NO_TEMPLIGHT=1 ./build.sh

# Collect and upload coverage data
[ "${COVERAGE}" = "true" ] && coveralls \
-b "bin" \
--exclude "3rd" \
--exclude "test" \
--exclude "bin/3rd" \
--exclude "bin/test" \
--gcov gcov-4.8 --gcov-options '\-lp'

sudo apt-get install clang-3.7
cd bin
Expand Down

0 comments on commit 77514e5

Please sign in to comment.