travis: code coverage, maybe?

This commit is contained in:
Colin Dellow 2018-07-05 18:47:33 -04:00
parent e3c6bad9f5
commit 68ecfde4d9
4 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,5 @@
language: cpp
script: ./travis-linux
sudo: required
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@ -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

View File

@ -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 "$@"

View File

@ -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