From f1ce176e75724a5e667683511dd16bec21349ea4 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 16:30:28 -0800 Subject: [PATCH 1/9] also build on OS X --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3960bb1..629dc6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,11 @@ matrix: addons: apt: packages: [ 'protobuf-compiler', 'libprotobuf-dev' ] + - os: osx install: + - if [[ $(uname -s) == 'Darwin' ]]; then brew install protobuf; fi; - make script: From 01caa22bfce445d0b10d582988cf8708f137bdad Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 16:55:21 -0800 Subject: [PATCH 2/9] enable coverage --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.travis.yml b/.travis.yml index 629dc6c..884b7fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,30 @@ matrix: addons: apt: packages: [ 'protobuf-compiler', 'libprotobuf-dev' ] + - os: linux + env: COVERAGE=gcov-4.9 CXX=g++-4.9 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: [ 'g++-4.9', 'protobuf-compiler', 'libprotobuf-dev' ] - os: osx install: - if [[ $(uname -s) == 'Darwin' ]]; then brew install protobuf; fi; + - if [ -n "${COVERAGE}" ]; then + export CXXFLAGS="--coverage"; + export CFLAGS="--coverage"; + export LDFLAGS="--coverage"; + fi; - make script: - echo '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0,0]}}' > test.json - ./tippecanoe -o test.mbtiles test.json + - if [ -n "${COVERAGE}" ]; then + rm vector_tile.pb.o; + ${COVERAGE} -lp *.o; + pip install --user cpp-coveralls; + ~/.local/bin/coveralls --no-gcov -i ./; + fi From 28b83cbe474c2cd106bb3b540cf15d0d94af232e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 17:02:49 -0800 Subject: [PATCH 3/9] ensure we use upgraded gcc as well as g++ --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 884b7fe..6c6e4af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ matrix: apt: packages: [ 'protobuf-compiler', 'libprotobuf-dev' ] - os: linux - env: COVERAGE=gcov-4.9 CXX=g++-4.9 + env: COVERAGE=gcov-4.9 CXX=g++-4.9 CC=gcc-4.9 addons: apt: sources: ['ubuntu-toolchain-r-test'] @@ -30,7 +30,6 @@ script: - echo '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0,0]}}' > test.json - ./tippecanoe -o test.mbtiles test.json - if [ -n "${COVERAGE}" ]; then - rm vector_tile.pb.o; ${COVERAGE} -lp *.o; pip install --user cpp-coveralls; ~/.local/bin/coveralls --no-gcov -i ./; From 893604ca9474b525247e4e218edb41cea376fb39 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 17:07:59 -0800 Subject: [PATCH 4/9] fix hardcoded cc --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3ecfc92..43d49d8 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ libjsonpull.a: jsonpull.o ranlib $@ %.o: %.c $(H) - cc $(PG) $(INCLUDES) -O3 -g -Wall $(CFLAGS) -c $< + $(CC) $(PG) $(INCLUDES) -O3 -g -Wall $(CFLAGS) -c $< %.o: %.cc $(H) $(CXX) $(PG) $(INCLUDES) -O3 -g -Wall $(CXXFLAGS) -c $< From 1f971bdfbd987255a23b11a470ec553a508e8777 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 17:08:41 -0800 Subject: [PATCH 5/9] travis: run coverage first, build in debug --- .travis.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c6e4af..7e49bb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,23 +5,26 @@ sudo: false matrix: include: - os: linux - addons: - apt: - packages: [ 'protobuf-compiler', 'libprotobuf-dev' ] - - os: linux + compiler: gcc env: COVERAGE=gcov-4.9 CXX=g++-4.9 CC=gcc-4.9 addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: [ 'g++-4.9', 'protobuf-compiler', 'libprotobuf-dev' ] + - os: linux + compiler: clang + addons: + apt: + packages: [ 'protobuf-compiler', 'libprotobuf-dev' ] - os: osx + compiler: clang install: - if [[ $(uname -s) == 'Darwin' ]]; then brew install protobuf; fi; - if [ -n "${COVERAGE}" ]; then - export CXXFLAGS="--coverage"; - export CFLAGS="--coverage"; + export CXXFLAGS="--coverage -g"; + export CFLAGS="--coverage -g"; export LDFLAGS="--coverage"; fi; - make @@ -30,6 +33,7 @@ script: - echo '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0,0]}}' > test.json - ./tippecanoe -o test.mbtiles test.json - if [ -n "${COVERAGE}" ]; then + ls ${COVERAGE} -lp *.o; pip install --user cpp-coveralls; ~/.local/bin/coveralls --no-gcov -i ./; From ee43ab5fc81574d73ded7a0da0bfa6cb8bcd787c Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 17:12:58 -0800 Subject: [PATCH 6/9] fix syntax error --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7e49bb5..93f36c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ script: - echo '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0,0]}}' > test.json - ./tippecanoe -o test.mbtiles test.json - if [ -n "${COVERAGE}" ]; then - ls + ls; ${COVERAGE} -lp *.o; pip install --user cpp-coveralls; ~/.local/bin/coveralls --no-gcov -i ./; From 71463c132559fd4956abb84f4b85e321f342b2e2 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 17:16:55 -0800 Subject: [PATCH 7/9] avoid travis overwriting CC --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 93f36c2..1c9ac90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ matrix: include: - os: linux compiler: gcc - env: COVERAGE=gcov-4.9 CXX=g++-4.9 CC=gcc-4.9 + env: COVERAGE=gcov-4.9 addons: apt: sources: ['ubuntu-toolchain-r-test'] @@ -23,6 +23,8 @@ matrix: install: - if [[ $(uname -s) == 'Darwin' ]]; then brew install protobuf; fi; - if [ -n "${COVERAGE}" ]; then + export CXX=g++-4.9; + export CC=gcc-4.9; export CXXFLAGS="--coverage -g"; export CFLAGS="--coverage -g"; export LDFLAGS="--coverage"; From 2460b5712f32bdd3dbc4026dbb57d5116cbcbc92 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 17:20:59 -0800 Subject: [PATCH 8/9] add coverage badge and a few excludes --- .travis.yml | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1c9ac90..1e3b770 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,5 +38,5 @@ script: ls; ${COVERAGE} -lp *.o; pip install --user cpp-coveralls; - ~/.local/bin/coveralls --no-gcov -i ./; + ~/.local/bin/coveralls --no-gcov -i ./ --exclude clipper --exclude vector_tile.pb.cc --exclude vector_tile.pb.h; fi diff --git a/README.md b/README.md index 3ad7f94..adf5d14 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Builds [vector tilesets](https://www.mapbox.com/developers/vector-tiles/) from l features. This is a tool for [making maps from huge datasets](MADE_WITH.md). [![Build Status](https://travis-ci.org/mapbox/tippecanoe.svg)](https://travis-ci.org/mapbox/tippecanoe) +[![Coverage Status](https://coveralls.io/repos/mapbox/tippecanoe/badge.svg?branch=master&service=github)](https://coveralls.io/github/mapbox/tippecanoe?branch=master) Intent ------ From 88d02915d7812da6772b0017d35d32762c107d0d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 22 Dec 2015 17:23:56 -0800 Subject: [PATCH 9/9] remove vector_tile.pb.o --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e3b770..b124ee8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ script: - echo '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[0,0]}}' > test.json - ./tippecanoe -o test.mbtiles test.json - if [ -n "${COVERAGE}" ]; then - ls; + rm vector_tile.pb.o; ${COVERAGE} -lp *.o; pip install --user cpp-coveralls; ~/.local/bin/coveralls --no-gcov -i ./ --exclude clipper --exclude vector_tile.pb.cc --exclude vector_tile.pb.h;