1#! /bin/bash 2# 3# Copyright 2017, 2018 James E. King III 4# Distributed under the Boost Software License, Version 1.0. 5# (See accompanying file LICENSE_1_0.txt or copy at 6# http://www.boost.org/LICENSE_1_0.txt) 7# 8# Bash script to run in travis to perform codecov.io integration 9# 10 11### 12### NOTE: Make sure you grab .codecov.yml 13### 14 15# assumes cwd is the top level directory of the boost project 16# assumes an environment variable $SELF is the boost project name 17 18set -ex 19 20B2_VARIANT=debug 21ci/build.sh cxxflags=-fprofile-arcs cxxflags=-ftest-coverage linkflags=-fprofile-arcs linkflags=-ftest-coverage 22 23# switch back to the original source code directory 24cd $TRAVIS_BUILD_DIR 25 26# get the version of lcov 27lcov --version 28 29# coverage files are in ../../b2 from this location 30lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --base-directory "$BOOST_ROOT/libs/$SELF" --directory "$BOOST_ROOT" --capture --output-file all.info 31 32# all.info contains all the coverage info for all projects - limit to ours 33lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --extract all.info "*/boost/$SELF/*" "*/libs/$SELF/src/*" --output-file coverage.info 34 35# dump a summary on the console - helps us identify problems in pathing 36lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --list coverage.info 37 38# 39# upload to codecov.io 40# 41curl -s https://codecov.io/bash > .codecov 42chmod +x .codecov 43./.codecov -f coverage.info -X gcov -x "gcov-7" 44