{"id":20414572,"url":"https://github.com/codecov/example-cpp11-cmake","last_synced_at":"2025-10-29T03:51:13.029Z","repository":{"id":15844771,"uuid":"78873888","full_name":"codecov/example-cpp11-cmake","owner":"codecov","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-22T21:36:03.000Z","size":45,"stargazers_count":147,"open_issues_count":0,"forks_count":59,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-10-19T23:48:16.636Z","etag":null,"topics":["cmake","codecov","coverage","cpp","cpp11"],"latest_commit_sha":null,"homepage":null,"language":"CMake","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-13T18:12:49.000Z","updated_at":"2025-10-06T08:43:25.000Z","dependencies_parsed_at":"2024-11-15T12:16:45.746Z","dependency_job_id":null,"html_url":"https://github.com/codecov/example-cpp11-cmake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codecov/example-cpp11-cmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-cpp11-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-cpp11-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-cpp11-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-cpp11-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecov","download_url":"https://codeload.github.com/codecov/example-cpp11-cmake/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecov%2Fexample-cpp11-cmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281556915,"owners_count":26521571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","codecov","coverage","cpp","cpp11"],"created_at":"2024-11-15T06:11:12.589Z","updated_at":"2025-10-29T03:51:13.002Z","avatar_url":"https://github.com/codecov.png","language":"CMake","readme":"# [Codecov][1] CI CMake g++ cpp11 lcov Example\n[![Travis CI logo][travis-image]][travis-link]\n[![Codecov logo][codecov-image]][codecov-link]\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-cpp11-cmake.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-cpp11-cmake?ref=badge_shield)\n\n[![Build Status][travis-badge]][travis-link]\n[![codecov][codecov-badge]][codecov-link]\n[![MIT License][license-badge]](LICENSE.md)\n\nThe goal of this project is to build project with following tools:\n * C++ version: `C++11`\n * Build system: [`CMake`](https://cmake.org/)\n * C++ compiler: `g++` or Visual Studio\n * Libraries: `STL` only\n * Code coverage report: [`lcov`](http://ltp.sourceforge.net/coverage/lcov.php) and [`OpenCppCoverage`](https://github.com/OpenCppCoverage/OpenCppCoverage)(note: it should show the code coverage is below 100%)\n * [`CodeCov`](https://codecov.io/) (code coverage is measured by CodeCov).\n * Source: multiple files\n\n## Special Thanks\nGoes to [Richel Bilderbeek](https://github.com/richelbilderbeek) for inspiration and all work on [Travis CI tutorials](https://github.com/richelbilderbeek/travis_cpp_tutorial).\nHere is a [link](https://github.com/richelbilderbeek/travis_cmake_gcc_cpp11) to a project with the same structure (without `lcov`),\nand here is a [list](https://github.com/richelbilderbeek/travis_cpp_tutorial/blob/master/statuses.md) of all his Travis configuration examples.\n\n## Prerequisites\nTo build the project you need to install `CMake`. ([Install instructions](https://cmake.org/install/))\nTo display a code coverage report in the console, install `lcov`. ([`Download lcov`](http://ltp.sourceforge.net/coverage/lcov.php), [`Instructions`](http://ltp.sourceforge.net/coverage/lcov/readme.php))\n\n## Guide\n1. Compile with code coverage instrumentation enabled [(GCC)](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html).\n2. Execute the tests to generate the coverage data.\n3. (Optionally) generate and customize reports with `lcov`.\n4. Upload to CodeCov using the bash uploader.\n\n### Travis Setup Using lcov\nAdd to your `.travis.yml` file:\n```yml\naddons:\n  apt:\n    packages: lcov\n\nafter_success:\n# Create lcov report\n- lcov --capture --directory . --output-file coverage.info\n- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files\n- lcov --list coverage.info # debug info\n# Uploading report to CodeCov\n- bash \u003c(curl -s https://codecov.io/bash) -f coverage.info || echo \"Codecov did not collect coverage reports\"\n```\n\n### Travis Setup without lcov\nBy default the bash uploader processes the coverage data using gcov when no file is supplied.\n```yml\nafter_success:\n- bash \u003c(curl -s https://codecov.io/bash) || echo \"Codecov did not collect coverage reports\"\n```\n\n## Caveats\n### Private Repos\nAdd to your `.travis.yml` file:\n```yml\nafter_success:\n  - bash \u003c(curl -s https://codecov.io/bash) -t uuid-repo-token\n```\n\n## Example details\nThis repo can serve as the starting point for a new project. The following is worth noticing:\n1. Use of a build script instead of putting the commands into `.travis.yml`\n  - Allows local testing\n  - Allows usage of `set -e` to error out with meaningfull messages on any command failure\n2. Separate testing source tree\n  - Allows to easily enable/disable testing\n  - Allows usage in parent projects (you don't want to build the tests if you are consumed)\n  - You may want to exclude coverage of test files which is easier when they are in a separate folder.\n    Remember to use **full paths** for patterns (like `'*/tests/*'`)\n3. Use of travis cache to cache manually build 3rd-party dependencies (like boost)\n  - Speeds up build\n  - More can be added (e.g. `ccache`)\n  - Those need to be excluded from coverage info too\n\n## Authors\n* **RokKos** - [RokKos](https://github.com/RokKos)\n* **Rolf Eike Beer** - [DerDakon](https://github.com/DerDakon)\n* **Alexander Grund** - [Flamefire](https://github.com/Flamefire)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/RokKos/classes-c-/blob/master/LICENSE) file for details.\n\n1. More documentation at https://docs.codecov.io\n2. Configure codecov through the `codecov.yml` https://docs.codecov.io/docs/codecov-yaml\n\nWe are happy to help if you have any questions. Please email our Support at [support@codecov.io](mailto:support@codecov.io)\n\n[1]: https://codecov.io/\n[travis-badge]:    https://travis-ci.org/codecov/example-cpp11-cmake.svg?branch=master\n[travis-link]:     https://travis-ci.org/codecov/example-cpp11-cmake\n[travis-image]:    https://github.com/codecov/example-cpp1-cmake/blob/master/img/TravisCI.png\n[license-badge]:   https://img.shields.io/badge/license-MIT-007EC7.svg\n[codecov-badge]:   https://codecov.io/gh/codecov/example-cpp11-cmake/branch/master/graph/badge.svg\n[codecov-link]:    https://codecov.io/gh/codecov/example-cpp11-cmake\n[codecov-image]:   https://github.com/codecov/example-cpp1-cmake/blob/master/img/Codecov.png\n\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-cpp11-cmake.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-cpp11-cmake?ref=badge_large)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecov%2Fexample-cpp11-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecov%2Fexample-cpp11-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecov%2Fexample-cpp11-cmake/lists"}