[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

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