diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-01-09 19:13:29 -0800 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-01-09 19:13:29 -0800 |
commit | bebdc009b484295f06185b5bab884a3754bbbacd (patch) | |
tree | 36206ec73f7cf8cb0ac113dd476fd03f3dda8892 /travis.sh | |
parent | b55f32b278deddaf2c75d7d24b5722017850d6d1 (diff) |
Coverage support for coveralls.io.
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -49,7 +49,26 @@ lua_script() { make -j12 testlua USER_CPPFLAGS=`pkg-config lua5.2 --cflags` } +# A run that executes with coverage support and uploads to coveralls.io +coverage_install() { + sudo apt-get update -qq + sudo apt-get install protobuf-compiler libprotobuf-dev lua5.2 liblua5.2-dev + sudo pip install cpp-coveralls +} +coverage_script() { + make -j12 tests googlepbtests testlua WITH_JIT=yes \ + USER_CPPFLAGS="--coverage `pkg-config lua5.2 --cflags`" + make test +} +coverage_after_success() { + coveralls --exclude dynasm --exclude tests --exclude upb/bindings/linux --gcov-options '\-lp' +} + +if [ "$1" == "after_success" ] && [ "$UPB_TRAVIS_BUILD" != "coverage" ]; then + # after_success is only used for coverage. + exit +fi + set -e set -x eval ${UPB_TRAVIS_BUILD}_${1} - |