[tests] Upload coverage reports to coveralls.io

This commit is contained in:
Bruno de Oliveira Abinader
2016-02-19 18:29:58 +02:00
parent 675a628aa2
commit 1dbfbfe7e3
6 changed files with 66 additions and 1 deletions

View File

@@ -52,6 +52,11 @@ matrix:
env: FLAVOR=node BUILDTYPE=Release NODE_VERSION=4 _CXX=clang++-3.5 _CC=clang-3.5 CCACHE=1
addons: *clang35
# Linux - GCC 4.9 - Debug
- os: linux
compiler: ": linux-gcc49-debug"
env: FLAVOR=linux ACTION=coveralls _CXX=g++-4.9 _CC=gcc-4.9 CCACHE=1
addons: *gcc49
# Linux - GCC 4.9 - Release
- os: linux
@@ -96,6 +101,12 @@ env:
before_install:
- source ./scripts/set_compiler.sh
- source ./scripts/travis_helper.sh
- if [[ ${ACTION:-0} == 'coveralls' ]]; then
rvm install 2.3.0;
rvm use 2.3.0;
rvm rubygems latest --force;
gem install coveralls-lcov;
fi
install:
- ./platform/${FLAVOR}/scripts/install.sh

View File

@@ -119,6 +119,7 @@ endif
.PHONY: check
check: ; $(RUN) BUILDTYPE=Debug ENABLE_COVERAGE=1 check
coveralls: ; $(RUN) BUILDTYPE=Debug ENABLE_COVERAGE=1 coveralls
.PHONY: render
render: ; $(RUN) Makefile/mbgl-render

View File

@@ -8,7 +8,7 @@ This repository hosts the cross-platform Mapbox GL Native library, plus convenie
SDK | Languages | Build status
----|-----------|-------------
[Mapbox GL Native](INSTALL.md) | C++14 | [![Travis](https://travis-ci.org/mapbox/mapbox-gl-native.svg?branch=master)](https://travis-ci.org/mapbox/mapbox-gl-native/builds)
[Mapbox GL Native](INSTALL.md) | C++14 | [![Travis](https://travis-ci.org/mapbox/mapbox-gl-native.svg?branch=master)](https://travis-ci.org/mapbox/mapbox-gl-native/builds) [![Coverage Status](https://coveralls.io/repos/github/mapbox/mapbox-gl-native/badge.svg?branch=master)](https://coveralls.io/github/mapbox/mapbox-gl-native?branch=master)
[Mapbox Android SDK](platform/android/) | Java | [![Bitrise](https://www.bitrise.io/app/79cdcbdc42de4303.svg?token=_InPF8bII6W7J6kFr-L8QQ&branch=master)](https://www.bitrise.io/app/79cdcbdc42de4303)
[Mapbox iOS SDK](platform/ios/) | Objective-C or Swift | [![Bitrise](https://www.bitrise.io/app/7514e4cf3da2cc57.svg?token=OwqZE5rSBR9MVWNr_lf4sA&branch=master)](https://www.bitrise.io/app/7514e4cf3da2cc57)
[Mapbox OS X SDK](platform/osx/) | Objective-C or Swift | [![Bitrise](https://www.bitrise.io/app/155ef7da24b38dcd.svg?token=4KSOw_gd6WxTnvGE2rMttg&branch=master)](https://www.bitrise.io/app/155ef7da24b38dcd)

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
set -o pipefail
source ./platform/linux/scripts/setup.sh
################################################################################
# Coveralls
################################################################################
mapbox_time "make_coveralls" \
make coveralls -j${JOBS}

37
scripts/coveralls.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -e
set -o pipefail
PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
mapbox_time "install_lcov" \
mason install lcov 1.12
LCOV="`mason prefix lcov 1.12`/usr/bin/lcov"
mapbox_time "check_mason_lcov" \
command -v $LCOV > /dev/null 2>&1 || exit 1
mapbox_time "remove_coverage_info" \
rm -f "build/${HOST_SLUG}/${BUILDTYPE}/coverage.info"
# Run all unit tests
./scripts/run_tests.sh "build/${HOST_SLUG}/${BUILDTYPE}/test"
# Collect coverage data and save it into coverage.info
mapbox_time "lcov_capture" \
$LCOV \
--quiet \
--capture \
--no-external \
--gcov-tool "gcov-4.9" \
--directory "src/mbgl" \
--directory "platform" \
--directory "include/mbgl" \
--directory "build/${HOST_SLUG}/${BUILDTYPE}" \
--base-directory "build/${HOST_SLUG}/${BUILDTYPE}" \
--output-file "build/${HOST_SLUG}/${BUILDTYPE}/coverage.info"
mapbox_time "coveralls_upload" \
coveralls-lcov "build/${HOST_SLUG}/${BUILDTYPE}/coverage.info"

View File

@@ -174,6 +174,9 @@ test-%: Makefile/test
check: Makefile/test
./scripts/collect-coverage.sh
coveralls: Makefile/test
./scripts/coveralls.sh
#### Helper targets ############################################################
.PHONY: print-env