Travis: Fix coverage build. Now it finally works.

[skip appveyor]
This commit is contained in:
Alexey Sokolov
2015-08-25 23:41:59 +01:00
parent aafc06e793
commit b83f32fdcb
+23 -10
View File
@@ -39,7 +39,7 @@ before_install:
- if [[ "$BUILD_TYPE" == "normal" ]]; then export CFGFLAGS= MYCXXFLAGS= MYLDFLAGS=; fi
- if [[ "$BUILD_TYPE" == "asan" ]]; then export CFGFLAGS=--enable-debug MYCXXFLAGS="-fsanitize=address -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIE" MYLDFLAGS="-fsanitize=address -pie"; fi
- if [[ "$BUILD_TYPE" == "tsan" ]]; then export CFGFLAGS=--enable-debug MYCXXFLAGS="-fsanitize=thread -O1 -fPIE" MYLDFLAGS="-fsanitize=thread -pie"; fi
- if [[ "$BUILD_TYPE" == "coverage" ]]; then export CFGFLAGS=--enable-debug MYCXXFLAGS=--coverage MYLDFLAGS=--coverage; fi
- if [[ "$BUILD_TYPE" == "coverage" ]]; then export CFGFLAGS="--enable-debug --disable-perl --disable-python" MYCXXFLAGS=--coverage MYLDFLAGS=--coverage; fi
# UBSan randomly crashes clang, and very often :(
# CFGFLAGS=--enable-debug MYCXXFLAGS="-fsanitize=undefined -O1 -fPIE -fno-sanitize-recover" MYLDFLAGS="-fsanitize=undefined -pie -fno-sanitize-recover"
- if [[ "$TRAVIS_REPO_SLUG" == "znc/znc" && "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" ]]; then openssl aes-256-cbc -d -in .travis-github.enc -out ~/znc-docs-key -k ${SECRET_KEY}; fi
@@ -55,7 +55,16 @@ install:
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install g++-4.8; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CFGFLAGS="$CFGFLAGS --with-gtest=/usr/src/gtest"; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_TYPE" == "coverage" ]]; then sudo apt-get install lcov; gem install coveralls-lcov; fi
- |
if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_TYPE" == "coverage" ]]; then
# when travis upgrades ubuntu, install lcov from apt-get instead
sudo apt-get build-dep lcov
wget http://archive.ubuntu.com/ubuntu/pool/main/l/lcov/lcov_1.11.orig.tar.gz
tar xf lcov_1.11.orig.tar.gz
sudo make -C lcov-1.11/ install
gem install coveralls-lcov
lcov --directory . --zerocounters
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sw_vers; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sysctl -a | grep cpu; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sysctl -a | grep mem; fi
@@ -79,6 +88,18 @@ after_success:
- test -r .travis_after_all.py && python .travis_after_all.py || echo No .travis_after_all.py found
- test -r .to_export_back && echo $(cat .to_export_back) || echo No .to_export_back found
- export DUMMY_VAR=dummy-value $(cat .to_export_back)
- |
if [[ "$BUILD_TYPE" == "coverage" ]]; then
cd build/
ls -l /usr/bin|grep gcov
lcov --directory . --capture --output-file coverage.info --base-directory $(pwd) --gcov-tool /usr/bin/gcov-4.8 || exit 1
lcov --remove coverage.info '/usr/*' 'test/*' --output-file coverage.info || exit 1
lcov --list coverage.info || exit 1
coveralls-lcov coverage.info || exit 1
cd ..
else
echo "No coverage for this build"
fi
- |
if [ "$BUILD_LEADER" == "YES" ] && [ "$BUILD_AGGREGATE_STATUS" == "others_succeeded" ] && [ "$TRAVIS_REPO_SLUG" == "znc/znc" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
echo "All builds passed!"
@@ -86,14 +107,6 @@ after_success:
else
echo "Not leader"
fi
- |
if [[ "$BUILD_TYPE" == "coverage" ]]; then
cd build/
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' 'test/*' --output-file coverage.info
coveralls-lcov coverage.info
cd ..
fi
notifications:
irc:
channels: