The goal of this project is to build project with following tools:
C++11
CMake
g++
or Visual StudioSTL
onlylcov
and OpenCppCoverage
(note: it should show the code coverage is below 100%)CodeCov
(code coverage is measured by CodeCov).Goes to Richel Bilderbeek for inspiration and all work on Travis CI tutorials.
Here is a link to a project with the same structure (without lcov
),
and here is a list of all his Travis configuration examples.
To build the project you need to install CMake
. (Install instructions)
To display a code coverage report in the console, install lcov
. (Download lcov
, Instructions
)
lcov
.Add to your .travis.yml
file:
addons:
apt:
packages: lcov
after_success:
# Create lcov report
- lcov --capture --directory . --output-file coverage.info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
- lcov --list coverage.info # debug info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
By default the bash uploader processes the coverage data using gcov when no file is supplied.
after_success:
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
Add to your .travis.yml
file:
after_success:
- bash <(curl -s https://codecov.io/bash) -t uuid-repo-token
This repo can serve as the starting point for a new project. The following is worth noticing:
.travis.yml
set -e
to error out with meaningfull messages on any command failure'*/tests/*'
)ccache
)This project is licensed under the MIT License - see the LICENSE file for details.
codecov.yml
https://docs.codecov.io/docs/codecov-yaml
We are happy to help if you have any questions. Please email our Support at [email protected]