2 # must be executed in project root folder
4 # Copyright Hans Dembinski 2018-2019
5 # Distributed under the Boost Software License, Version 1.0.
6 # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
9 # gcov-9, gcov-7, gcov-6 do not work
11 if test $(which gcov-$i); then
19 LCOV_DIR="tools/lcov-${LCOV_VERSION}"
21 if [ ! -e $LCOV_DIR ]; then
23 curl -L https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz | tar zxf -
27 # --rc lcov_branch_coverage=1 doesn't work on travis
28 # LCOV="${LCOV_DIR}/bin/lcov --gcov-tool=${GCOV} --rc lcov_branch_coverage=1"
29 LCOV="${LCOV_DIR}/bin/lcov --gcov-tool=${GCOV}"
32 $LCOV --base-directory `pwd` \
33 --directory `pwd`/../../bin.v2/libs/histogram/test \
34 --capture --output-file coverage.info
36 # remove uninteresting entries
37 $LCOV --extract coverage.info "*/boost/histogram/*" --output-file coverage.info
39 if [ $CI ] || [ $1 ]; then
40 # upload if on CI or when token is passed as argument
41 which cpp-coveralls || echo "Error: you need to install cpp-coveralls"
43 cpp-coveralls -l coverage.info -r ../.. -n -t $1
45 cpp-coveralls -l coverage.info -r ../.. -n
48 # otherwise generate html report
49 $LCOV_DIR/bin/genhtml coverage.info --demangle-cpp -o coverage-report