- C++ version:
C++11 - Build system:
CMake - C++ compiler:
g++ - Libraries:
STLonly - Code coverage report:
lcov(note: it should show the code coverage is below 100%) CodeCov(code coverage is measured by CodeCov).- Source: multiple files
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)
- Compile with code coverage instrumentation enabled (GCC).
- Execute the tests to generate the coverage data.
- (Optionally) generate and customize reports with
lcov. - Upload to CodeCov using the bash uploader.
This repo can serve as the starting point for a new project. The following is worth noticing:
- Use of a build script instead of putting the commands into
.travis.yml
- Allows local testing
- Allows usage of
set -eto error out with meaningfull messages on any command failure
- Separate testing source tree
- Allows to easily enable/disable testing
- Allows usage in parent projects (you don't want to build the tests if you are consumed)
- You may want to exclude coverage of test files which is easier when they are in a separate folder.
Remember to use full paths for patterns (like
'*/tests/*')
- Use of travis cache to cache manually build 3rd-party dependencies (like boost)
- Speeds up build
- More can be added (e.g.
ccache) - Those need to be excluded from coverage info too