Skip to content

Commit

Permalink
Added coveralls integration
Browse files Browse the repository at this point in the history
  • Loading branch information
flippmoke committed Mar 2, 2015
1 parent ea87a49 commit 7a4a0df
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
31 changes: 24 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ matrix:
- os: osx
compiler: gcc

matrix:
include:
- os: osx
compiler: clang
env: NODE_VERSION="1.2.0" JOBS=8 COVERAGE=true

env:
matrix:
- NODE_VERSION="0.10.36" JOBS=8 # node abi 11
- NODE_VERSION="0.11.14" JOBS=8 # node abi 14, but versioned on major.minor.patch since it is an unstable series
- NODE_VERSION="0.12.0" JOBS=8 # node abi 14
- NODE_VERSION="1.0.4" JOBS=8 # node abi 42
- NODE_VERSION="1.2.0" JOBS=8 # node abi 43
- NODE_VERSION="0.10.36" JOBS=8 COVERAGE=false # node abi 11
- NODE_VERSION="0.11.14" JOBS=8 COVERAGE=false # node abi 14, but versioned on major.minor.patch since it is an unstable series
- NODE_VERSION="0.12.0" JOBS=8 COVERAGE=false # node abi 14
- NODE_VERSION="1.0.4" JOBS=8 COVERAGE=false # node abi 42
- NODE_VERSION="1.2.0" JOBS=8 COVERAGE=false # node abi 43
global:
- secure: F42vcZEgWgCMDvQXlmyYmWwFo86fUjlJbsvXEwyliaMfasjCNsbmeILU61aScn8daiCGD+vRUaRlmv+XxUSS2G8FaoI8ZjwgMo2guMwthAQJ1ohTvf4bZI0JqVYKnnZpzhGPv2zD0DTdt31l30qn2GZnnGrF4yFpPU1HW2HcMuE=
- secure: WRWrn3KjCaevRo2htdvn26euALTZNCDtcSlQvtH6Bc7yLdhlH5apj+qSuWqlN59f1cprFH+5aQ2zmBkVmAV2DT4IbsfszMIR6k6EetuY6VOugo/qsPW2x/MQbpFgjCbl95bYty4eUH9Bcf70Pz/S+XVewABXHWikJiLUiZBbLyE=
Expand All @@ -47,18 +53,29 @@ before_install:
- npm --version
- PUBLISH_BINARY=false
- REPUBLISH_BINARY=false
- if [[ ${COVERAGE} == true ]]; then
brew update;
brew install pyenv;
eval "$(pyenv init -)";
pyenv install 2.7.6;
pyenv global 2.7.6;
pyenv rehash;
pip install cpp-coveralls;
pyenv rehash;
fi;

install:
- if [[ "${CXX}" =~ "g++" ]]; then export JOBS=2; fi;
- if [[ ${COMMIT_MESSAGE} =~ "[test binary]" ]]; then npm install --fallback-to-build=false; else ./scripts/build_against_sdk.sh && rm -rf sdk; fi;
- npm test

before_script:
- if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]] && [[ ${CXX} =~ "clang" ]]; then PUBLISH_BINARY=true; fi;
- if [[ ${COMMIT_MESSAGE} =~ "[republish binary]" ]] && [[ ${CXX} =~ "clang" ]]; then REPUBLISH_BINARY=true; fi;
- if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]] && [[ ${CXX} =~ "clang" ]] && [[ ${COVERAGE} == false ]]; then PUBLISH_BINARY=true; fi;
- if [[ ${COMMIT_MESSAGE} =~ "[republish binary]" ]] && [[ ${CXX} =~ "clang" ]] && [[ ${COVERAGE} == false ]]; then REPUBLISH_BINARY=true; fi;

script:
- node-pre-gyp package testpackage
- if [[ ${COVERAGE} == true ]]; then cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude tools --exclude docs; fi;
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp publish; fi;
- if [[ ${REPUBLISH_BINARY} == true ]]; then node-pre-gyp unpublish && node-pre-gyp publish; fi;
- if [[ ${PUBLISH_BINARY} == true ]] || [[ ${REPUBLISH_BINARY} == true ]]; then node-pre-gyp info; rm -rf {build,lib/binding}; node-pre-gyp install; npm test; fi
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ all: build-all
build-all: ./node_modules ./build
./node_modules/.bin/node-pre-gyp build --loglevel=error --clang=1

debug: ./node_modules
debug: ./node_modules ./build
./node_modules/.bin/node-pre-gyp build --debug --clang=1

coverage: ./node_modules ./build
./node_modules/.bin/node-pre-gyp build --debug --clang=1 --coverage=true

verbose: ./node_modules
./node_modules/.bin/node-pre-gyp build --loglevel=verbose --clang=1

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Bindings to [Mapnik](http://mapnik.org) for [node](http://nodejs.org).

[![Build Status](https://secure.travis-ci.org/mapnik/node-mapnik.png)](https://travis-ci.org/mapnik/node-mapnik)
[![Build status](https://ci.appveyor.com/api/projects/status/ju29v1vcpif2iww8?svg=true)](https://ci.appveyor.com/project/Mapbox/node-mapnik)
[![Coverage Status](https://coveralls.io/repos/mapnik/node-mapnik/badge.svg)](https://coveralls.io/r/mapnik/node-mapnik)

## Usage

Expand Down
14 changes: 14 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
'includes': [ 'common.gypi' ],
'variables': {
'coverage': 'false'
},
'targets': [
{
'target_name': 'action_before_build',
Expand Down Expand Up @@ -73,6 +76,17 @@
],
'defines': ['MAPNIK_GIT_REVISION="<!@(mapnik-config --git-describe)"'],
'conditions': [
["coverage == 'true'", {
"cflags_cc": ["--coverage"],
"xcode_settings": {
"OTHER_CPLUSPLUSFLAGS":[
"--coverage"
],
'OTHER_LDFLAGS':[
'--coverage'
]
}
}],
['OS=="win"',
{
'include_dirs':[
Expand Down

0 comments on commit 7a4a0df

Please sign in to comment.