Skip to content

Codecov Setup

vhirtham edited this page Mar 17, 2018 · 5 revisions

If the coverage should be tracked, --coverage must be added to the compile flags and the sources must be build in debug mode. After building the project, you need to tun all tests to create the coverage reports. If that is done use:

lcov --directory build --capture --output-file coverage.info

To filter certain directories use:

lcov --remove coverage.info 'usr/*' --output-file coverage.info

If you are using travis to create the coverage reports for the codecov homepage you can use the command below. However, the report file should be in the source directory and also the command should be executed from there, otherwise the reports might not show the desired files.

bash <(curl -s https://codecov.io/bash)

If you use a docker image to build on travis, you might need to create a shared volume to pass the report out of the docker run. There are also other alternatives shown on the codecov homepage. The info how to start docker with a shared volume, have a look here.

  • Get the link to the codecov batch on the codecov homepage from the projects settings menu.

https://github.com/codecov/support/wiki/Codecov-Yaml

Clone this wiki locally