]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/histogram/tools/cov.sh
buildsys: change download over to reef release
[ceph.git] / ceph / src / boost / libs / histogram / tools / cov.sh
CommitLineData
92f5a8d4
TL
1#!/bin/sh
2# must be executed in project root folder
3
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
7
8if [ -z $GCOV ]; then
9 # gcov-9, gcov-7, gcov-6 do not work
10 for i in 8 5; do
11 if test $(which gcov-$i); then
12 GCOV=gcov-$i
13 break;
14 fi;
15 done
16fi
17
18LCOV_VERSION="1.14"
19LCOV_DIR="tools/lcov-${LCOV_VERSION}"
20
21if [ ! -e $LCOV_DIR ]; then
22 cd tools
23 curl -L https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz | tar zxf -
24 cd ..
25fi
26
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"
29LCOV="${LCOV_DIR}/bin/lcov --gcov-tool=${GCOV}"
30
31# collect raw data
32$LCOV --base-directory `pwd` \
33 --directory `pwd`/../../bin.v2/libs/histogram/test \
34 --capture --output-file coverage.info
35
36# remove uninteresting entries
37$LCOV --extract coverage.info "*/boost/histogram/*" --output-file coverage.info
38
20effc67 39if [ $1 ]; then
92f5a8d4
TL
40 # upload if on CI or when token is passed as argument
41 which cpp-coveralls || echo "Error: you need to install cpp-coveralls"
20effc67
TL
42 cpp-coveralls -l coverage.info -r ../.. -n -t $1
43elif [ ! $CI ]; then
92f5a8d4
TL
44 # otherwise generate html report
45 $LCOV_DIR/bin/genhtml coverage.info --demangle-cpp -o coverage-report
46fi