codecov.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. ### NOTE: Make sure you grab .codecov.yml
  12. ###
  13. # assumes cwd is the top level directory of the boost project
  14. # assumes an environment variable $SELF is the boost project name
  15. set -ex
  16. B2_VARIANT=debug
  17. ci/build.sh cxxflags=-fprofile-arcs cxxflags=-ftest-coverage linkflags=-fprofile-arcs linkflags=-ftest-coverage
  18. # switch back to the original source code directory
  19. cd $TRAVIS_BUILD_DIR
  20. # get the version of lcov
  21. lcov --version
  22. # coverage files are in ../../b2 from this location
  23. lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --base-directory "$BOOST_ROOT/libs/$SELF" --directory "$BOOST_ROOT" --capture --output-file all.info
  24. # all.info contains all the coverage info for all projects - limit to ours
  25. lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --extract all.info "*/boost/$SELF/*" "*/libs/$SELF/src/*" --output-file coverage.info
  26. # dump a summary on the console - helps us identify problems in pathing
  27. lcov --gcov-tool=gcov-7 --rc lcov_branch_coverage=1 --list coverage.info
  28. #
  29. # upload to codecov.io
  30. #
  31. curl -s https://codecov.io/bash > .codecov
  32. chmod +x .codecov
  33. ./.codecov -f coverage.info -X gcov -x "gcov-7"