[tests] Upload coverage reports to coveralls.io
This commit is contained in:
11
.travis.yml
11
.travis.yml
@@ -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
|
||||
|
||||
1
Makefile
1
Makefile
@@ -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
|
||||
|
||||
@@ -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 | [](https://travis-ci.org/mapbox/mapbox-gl-native/builds)
|
||||
[Mapbox GL Native](INSTALL.md) | C++14 | [](https://travis-ci.org/mapbox/mapbox-gl-native/builds) [](https://coveralls.io/github/mapbox/mapbox-gl-native?branch=master)
|
||||
[Mapbox Android SDK](platform/android/) | Java | [](https://www.bitrise.io/app/79cdcbdc42de4303)
|
||||
[Mapbox iOS SDK](platform/ios/) | Objective-C or Swift | [](https://www.bitrise.io/app/7514e4cf3da2cc57)
|
||||
[Mapbox OS X SDK](platform/osx/) | Objective-C or Swift | [](https://www.bitrise.io/app/155ef7da24b38dcd)
|
||||
|
||||
13
platform/linux/scripts/coveralls.sh
Executable file
13
platform/linux/scripts/coveralls.sh
Executable 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
37
scripts/coveralls.sh
Executable 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"
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user