From bebdc009b484295f06185b5bab884a3754bbbacd Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Fri, 9 Jan 2015 19:13:29 -0800 Subject: Coverage support for coveralls.io. --- travis.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'travis.sh') diff --git a/travis.sh b/travis.sh index b4c1afa..1cb6a04 100755 --- a/travis.sh +++ b/travis.sh @@ -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} - -- cgit v1.2.3