summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml11
-rw-r--r--Makefile1
-rw-r--r--README.md2
-rwxr-xr-xplatform/linux/scripts/coveralls.sh13
-rwxr-xr-xscripts/coveralls.sh37
-rw-r--r--scripts/main.mk3
6 files changed, 66 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index ecc3e2c0e3..69d1041dc5 100644
--- a/.travis.yml
+++ b/.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
diff --git a/Makefile b/Makefile
index 498bb8a815..5cada812d7 100644
--- a/Makefile
+++ b/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
diff --git a/README.md b/README.md
index a70aba07ec..115f805891 100644
--- a/README.md
+++ b/README.md
@@ -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)
diff --git a/platform/linux/scripts/coveralls.sh b/platform/linux/scripts/coveralls.sh
new file mode 100755
index 0000000000..468fa4774b
--- /dev/null
+++ b/platform/linux/scripts/coveralls.sh
@@ -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}
diff --git a/scripts/coveralls.sh b/scripts/coveralls.sh
new file mode 100755
index 0000000000..79e398dc1f
--- /dev/null
+++ b/scripts/coveralls.sh
@@ -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"
diff --git a/scripts/main.mk b/scripts/main.mk
index de49c9967a..a215be635f 100644
--- a/scripts/main.mk
+++ b/scripts/main.mk
@@ -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