CheckOps
gcovr
gcovr is a BSD-3-Clause Python tool that summarises GCC/gcov (and LLVM gcov-compatible) coverage for C and C++, producing text, HTML, Cobertura, JaCoCo, LCOV, SonarQube, Coveralls, JSON, CSV and Markdown reports.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
gcovr provides a utility for managing the use of the GNU gcov tool and generating summarised code coverage results for C and C++. Its README says it is inspired by Python’s coverage.py. You compile with coverage flags (such as --coverage), run your tests, and gcovr collects the resulting data into readable reports, without having to run gcov file by file.
The gcovr command produces many report formats: plain text, HTML (single page, detailed per-file pages or nested directory views, with custom templates), Cobertura XML, JaCoCo XML, Clover, LCOV, SonarQube generic coverage, Coveralls JSON, gcovr’s own JSON and JSON summary, CSV and Markdown. It supports line, branch and decision coverage, filters and exclusions, merging of multiple runs, thresholds that fail builds (--fail-under-line, --fail-under-branch), and works with GCC and with Clang’s gcov-compatible output. Version 8.8 was released on 27 October 2026.
The source code is at gcovr/gcovr on GitHub under the BSD-3-Clause licence, with about 996 stars; the most recent commit was on 7 November 2026.
Features
- Many formats: HTML, Cobertura, JaCoCo, LCOV, SonarQube, Coveralls and more.
- Branch and decision coverage: Beyond simple line coverage.
- Thresholds: Fail builds below targets.
- Merge runs: Combine coverage from multiple test runs.
Pros
- Free to use: Open source under the BSD-3-Clause licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 7 November 2026.
Cons
- Requires instrumented builds: You must compile with coverage flags.
- gcov compatibility: Results depend on compiler and gcov versions matching.
Usage and Links (Example)
pip install gcovr
cmake -B build -DCMAKE_CXX_FLAGS="--coverage" && cmake --build build
ctest --test-dir build
gcovr -r . --html-details coverage.html --cobertura coverage.xml --fail-under-line 80
Resources:
Pricing
gcovr is free and open source under the BSD-3-Clause licence.
Recommended for?
- C and C++ projects using GCC or Clang that need coverage reports.
- CI pipelines feeding SonarQube, Codecov or Coveralls.
Conclusion
gcovr is the most convenient way to turn gcov data into useful C and C++ coverage reports for humans and CI.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with gcovr side by side.
GGoogleTestGoogleTest is Google's BSD-3-Clause C++ test framework, merged with GoogleMock, providing xUnit-style tests, rich assertions, death tests, parameterised and typed tests, and C++ mocking.Compare with gcovr
CCatch2Catch2 is a BSL-1.0 C++ unit testing framework with natural assertions, free-form test names, sections for shared setup, BDD-style macros and built-in micro-benchmarking.Compare with gcovr
Ddoctestdoctest is an MIT-licensed, single-header C++ testing framework that is the fastest feature-rich option in compile times and runtime, letting tests live next to production code and be stripped from release binaries.Compare with gcovr
CCppUTestCppUTest is a BSD-3-Clause unit testing and mocking framework for C and C++, popular in embedded development for its small footprint, memory leak detection and CppUMock.Compare with gcovr
CCodecovCodecov by Sentry is a code coverage reporting service that shows coverage for any language, CI and code host in pull request comments and dashboards, with flags, carryforward, test analytics for flaky tests and AI test generation.Compare with gcovr
CCoverallsCoveralls is a hosted code coverage history and statistics service that integrates with your CI to report repository, file and line-by-line coverage with pull request notices; free for open source with paid plans for private repos.Compare with gcovr