diff --git a/.travis.yml b/.travis.yml index d02b07a..dd3311e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ language: cpp script: ./travis-linux sudo: required +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/build/Makefile.linux b/build/Makefile.linux index 7a73a50..6da8e6d 100644 --- a/build/Makefile.linux +++ b/build/Makefile.linux @@ -41,14 +41,15 @@ ZSTD_LIB = $(ZSTD)/libzstd.a # Flags CC = gcc CXX = g++ +OPTIMIZATIONS = -O3 CPUS:=$(shell nproc) -CFLAGS = -I $(SQLITE) -I $(PARQUET_CPP)/src -I $(ARROW)/cpp/src -O3 -std=c++11 -Wall -fPIC -g +CFLAGS = -I $(SQLITE) -I $(PARQUET_CPP)/src -I $(ARROW)/cpp/src $(OPTIMIZATIONS) -std=c++11 -Wall -fPIC -g ALL_LIBS = $(PARQUET_CPP_LIB) $(LZ4_LIB) $(ZSTD_LIB) $(THRIFT_LIB) $(SNAPPY_LIB) $(ARROW_LIB) \ $(ICU_I18N_LIB) $(ICU_UC_LIB) $(ICU_DATA_LIB) \ $(BROTLI_ENC_LIB) $(BROTLI_COMMON_LIB) $(BROTLI_DEC_LIB) $(BOOST_REGEX_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) -LDFLAGS = -O3 \ +LDFLAGS = $(OPTIMIZATIONS) \ -Wl,--whole-archive $(ALL_LIBS) \ -Wl,--no-whole-archive -lz -lcrypto -lssl OBJ = parquet.o parquet_filter.o parquet_table.o parquet_cursor.o diff --git a/make-linux b/make-linux index 01364d2..b0eddd2 100755 --- a/make-linux +++ b/make-linux @@ -95,7 +95,13 @@ main() { if [ -v PREBUILT ]; then fetch_prebuilt_libs fi - make ${lib_locs[@]-} "$@" + + optimizations="-O3" + if [ -v COVERAGE ]; then + optimizations="-fprofile-arcs -ftest-coverage" + fi + + make ${lib_locs[@]-} "$@" OPTIMIZATIONS="$optimizations" } main "$@" diff --git a/travis-linux b/travis-linux index 81f26f6..9d3e226 100755 --- a/travis-linux +++ b/travis-linux @@ -4,5 +4,5 @@ set -euo pipefail sudo apt-get install software-properties-common sudo add-apt-repository --yes ppa:george-edison55/cmake-3.x sudo apt-get update -PREBUILT=1 ./make-linux +COVERAGE=1 PREBUILT=1 ./make-linux ./tests/test-all