All Projects → codecov → Example Cpp11 Cmake

codecov / Example Cpp11 Cmake

Licence: mit

Programming Languages

cpp
1120 projects
cpp11
221 projects

Projects that are alternatives of or similar to Example Cpp11 Cmake

Moderncppstarter
🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.
Stars: ✭ 2,381 (+1745.74%)
Mutual labels:  cmake, coverage, codecov
ts-node-starter
GitHub template to get started with Node.js & TypeScript. ⚡
Stars: ✭ 28 (-78.29%)
Mutual labels:  coverage, codecov
example-objc
Codecov example for Xcode
Stars: ✭ 24 (-81.4%)
Mutual labels:  coverage, codecov
phpunit-travis-ci-coverage-example
phpUnit Testing on Travis-CI with Code Coverage on CodeCov
Stars: ✭ 30 (-76.74%)
Mutual labels:  coverage, codecov
travis-ci-tutorial-java
Just to learn how to use travis-ci in a java project!
Stars: ✭ 38 (-70.54%)
Mutual labels:  coverage, codecov
gocoverutil
No description or website provided.
Stars: ✭ 25 (-80.62%)
Mutual labels:  coverage, codecov
enterprise
Code coverage done right.® On-premise enterprise version.
Stars: ✭ 63 (-51.16%)
Mutual labels:  coverage, codecov
Codecov Python
Python report uploader for Codecov
Stars: ✭ 162 (+25.58%)
Mutual labels:  coverage, codecov
Covr
Test coverage reports for R
Stars: ✭ 285 (+120.93%)
Mutual labels:  coverage, codecov
Cpp Project
Boiler plate template for C++ projects, with CMake, Doctest, Travis CI, Appveyor, Github Actions and coverage reports.
Stars: ✭ 328 (+154.26%)
Mutual labels:  cmake, codecov
Learn Istanbul
🏁 Learn how to use the Istanbul JavaScript Code Coverage Tool
Stars: ✭ 332 (+157.36%)
Mutual labels:  coverage, codecov
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (+56.59%)
Mutual labels:  cmake, coverage
Modern Cpp Template
A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
Stars: ✭ 690 (+434.88%)
Mutual labels:  cmake, codecov
Example Swift
Codecov: Swift coverage example
Stars: ✭ 121 (-6.2%)
Mutual labels:  coverage, codecov
Codecov Bash
Global coverage report uploader for Codecov
Stars: ✭ 220 (+70.54%)
Mutual labels:  coverage, codecov
CPP Template
C++ project template : CMake, Test, Travis CI, Appveyor, CodeCoverage, Doxygen
Stars: ✭ 32 (-75.19%)
Mutual labels:  coverage, codecov
Codecov Node
Global coverage report uploader for Codecov in NodeJS
Stars: ✭ 268 (+107.75%)
Mutual labels:  coverage, codecov
Kcov
Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options
Stars: ✭ 515 (+299.22%)
Mutual labels:  coverage, codecov
Example Gradle
Stars: ✭ 68 (-47.29%)
Mutual labels:  coverage, codecov
Llvm Pass Tutorial
A step-by-step tutorial for building an LLVM sample pass
Stars: ✭ 122 (-5.43%)
Mutual labels:  cmake

Codecov CI CMake g++ cpp11 lcov Example

Travis CI logo Codecov logo FOSSA Status

Build Status codecov MIT License

The goal of this project is to build project with following tools:

  • C++ version: C++11
  • Build system: CMake
  • C++ compiler: g++ or Visual Studio
  • Libraries: STL only
  • Code coverage report: lcov and OpenCppCoverage(note: it should show the code coverage is below 100%)
  • CodeCov (code coverage is measured by CodeCov).
  • Source: multiple files

Special Thanks

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.

Prerequisites

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)

Guide

  1. Compile with code coverage instrumentation enabled (GCC).
  2. Execute the tests to generate the coverage data.
  3. (Optionally) generate and customize reports with lcov.
  4. Upload to CodeCov using the bash uploader.

Travis Setup Using 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"

Travis Setup without lcov

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"

Caveats

Private Repos

Add to your .travis.yml file:

after_success:
  - bash <(curl -s https://codecov.io/bash) -t uuid-repo-token

Example details

This repo can serve as the starting point for a new project. The following is worth noticing:

  1. Use of a build script instead of putting the commands into .travis.yml
  • Allows local testing
  • Allows usage of set -e to error out with meaningfull messages on any command failure
  1. 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/*')
  1. 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

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

  1. More documentation at https://docs.codecov.io
  2. Configure codecov through the 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]

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].