Codecov CI CMake g++ cpp11 lcov Example
The goal of this project is to build project with following tools:
- C++ version:
C++11
- Build system:
CMake
- C++ compiler:
g++
- Libraries:
STL
only - Code coverage:
lcov
(note: it should show the code coverage is below 100%) CodeCov
(code coverage is measured by CodeCov).- Source: multiple files
Goes to Richel Bilderbeek for inspiration and all work on Travis CI tutorials.
Here is link to the same project with structure (except no lcov
) and here is list of all his projects if you want make build with travis but with different configuration.
To build the project you need to install CMake
. Here are the instructions. To create code coverage report you need to install lcov
. Download lcov
from here you can download latest lcov
and here are instructions
. This reports will be later uploaded to CodeCov servers.
Add to your .travis.yml
file.
language: cpp
compiler:
- g++
after_success:
# Creating report
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --capture --output-file coverage.info # capture coverage info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
- lcov --list coverage.info #debug info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
Gather reports:
lcov --directory . --capture --output-file coverage.info
Add to your .travis.yml
file.
after_success:
- bash <(curl -s https://codecov.io/bash) -t uuid-repo-token
This project is licensed under the MIT License - see the LICENSE file for details.
- More documentation at https://docs.codecov.io
- Configure codecov through the
codecov.yml
https://docs.codecov.io/docs/codecov-yaml
We are happy to help if you have any questions. Please contact email our Support at [email protected]