Freedom251 › Test Coverage Tools
gcovr

What gcovr is
gcovr is a command-line utility for collecting GNU gcov data and turning it into code coverage reports for C and C++ projects. A typical workflow is to compile with GCC coverage flags, run the test suite, then invoke gcovr to produce a summarized, tabular result. Reports are available as text, HTML, CSV, JSON, Markdown, Clover XML, Cobertura XML, Coveralls JSON, JaCoCo XML, LCOV, and SonarQube output. HTML reports can show an overview or annotated source, and can be nested, self-contained, themed, or based on a customizable template. Coverage results can be passed into tools that accept its output formats: Cobertura XML works with Jenkins and Hudson coverage plugins, and gcovr can create SonarQube-compatible XML with line, branch, condition, or decision metrics. JaCoCo XML includes line, branch, and method counters. The tool also supports filters for coverage-data searches and symlinks, configuration files, exclusion markers, and reproducible timestamps. It runs on Linux, Windows, and macOS and requires Python 3.10 or newer, together with GCC or Clang. Its branch results follow GCC control-flow arcs and may count compiler-generated branches, making 100% branch coverage unattainable for most programs. gcovr is free and released under the BSD 3-Clause License.
Who it suits
gcovr suits C and C++ developers who collect GNU gcov coverage data and need reports in formats used by their workflow or CI tools. It is a fit for teams using Linux, Windows, or macOS with Python 3.10 or newer and GCC or Clang.
What it does well
- Produces reports in text, HTML, CSV, JSON, Markdown, and several XML formats.
- HTML output includes overview and annotated-source report options.
- Cobertura output works with Jenkins and Hudson coverage plugins.
- SonarQube and JaCoCo formats carry coverage counters.
- BSD 3-Clause License permits redistribution subject to its conditions.
What to know first
- Requires Python 3.10 or newer.
- Branch coverage may include compiler-generated branches.
- 100% branch coverage is impossible for most programs.
Limits
Branch coverage is based on GCC low-level control-flow arcs and may include compiler-generated branches, so 100% branch coverage is impossible for most programs.
Getting started
- Open https://gcovr.com/.
- Install gcovr as a Python package with pip.
- Compile the project with GCC coverage flags.
- Run the test suite.
- Invoke gcovr to generate a tabular report or choose a supported report format.
Verdict
Choose gcovr when a C or C++ project needs summarized gcov results in formats such as Cobertura, JaCoCo, or SonarQube. Look elsewhere if your coverage workflow depends on achieving 100% branch coverage, since GCC arc data can include compiler-generated branches.
Questions
Is gcovr free?
Yes. Its pricing model is free, and a free plan is listed.
Which operating systems does it support?
gcovr supports Linux, Windows, and macOS.
What does it require?
The current release supports Python 3.10 and newer and works with GCC or Clang.
Which languages does it cover?
The listed supported languages are C and C++.
What license does gcovr use?
It is released under the BSD 3-Clause License, which permits redistribution and use in source and binary forms subject to its conditions.
Where can users get help?
The documentation points users to GitHub tickets, Stack Overflow, and Gitter.
Facts from gcovr's own pages
- CI integration
- Cobertura XML output is suitable for import into Jenkins and Hudson through coverage plugins. · gcovr.com, 30 Sept 2026
- Command-line tool
- gcovr is described as a command-line alternative to lcov. · gcovr.com, 1 Oct 2026
- Compilers
- Development testing covers GCC and Clang. · gcovr.com, 30 Sept 2026
- Configuration
- The user guide includes configuration files, exclusion markers and reproducible timestamp features. · gcovr.com, 1 Oct 2026
- Coverage reports
- It can produce text, HTML, CSV, JSON, Markdown, Clover XML, Cobertura XML, Coveralls JSON, JaCoCo XML, LCOV, and SonarQube reports. · gcovr.com, 30 Sept 2026
- Coverage types
- Its branch coverage reports are based on GCC's -fprofile-arcs control-flow graph data. · gcovr.com, 1 Oct 2026
- Decision coverage
- The --decisions option parses source code to extract a decision-coverage metric. · gcovr.com, 1 Oct 2026
- Filters
- gcovr supports filters for speeding up coverage-data searches and filtering symlinks. · gcovr.com, 1 Oct 2026
- HTML reports
- HTML output can provide an overview of all files, annotated source files and custom Jinja2 templates. · gcovr.com, 1 Oct 2026
- Installation
- gcovr is distributed as a Python package installable with pip, with development versions installable from GitHub. · gcovr.com, 1 Oct 2026
- Integrations
- Cobertura XML can be used with Jenkins, and gcovr also produces Coveralls and SonarQube formats. · gcovr.com, 1 Oct 2026
- JaCoCo integration
- gcovr can generate JaCoCo XML output containing line, branch, and method counters. · gcovr.com, 30 Sept 2026
- License
- gcovr is available under the BSD 3-Clause License. · gcovr.com, 1 Oct 2026
- Maintainers
- The documentation lists Lukas Atkinson and Michael Förderer as maintainers. · gcovr.com, 1 Oct 2026
- Notable limitation
- gcovr's branch coverage is based on GCC's low-level control-flow graph arcs, so reports can include compiler-generated branches and 100% branch coverage is impossible for most programs. · gcovr.com, 30 Sept 2026
- Operating systems
- The project supports Linux, Windows, and macOS. · gcovr.com, 30 Sept 2026
- Purpose
- gcovr manages GNU gcov and generates summarized code coverage results. · gcovr.com, 1 Oct 2026
- Python requirement
- The current release supports Python 3.10 and newer. · gcovr.com, 30 Sept 2026
- Quality assurance
- Pull requests are automatically tested on Windows and Linux, and code coverage is collected. · gcovr.com, 1 Oct 2026
- Report formats
- It generates text, HTML, CSV, JSON, Markdown, Clover, Cobertura, Coveralls, JaCoCo, LCOV and SonarQube reports. · gcovr.com, 1 Oct 2026
- Runtime requirements
- The current documentation supports Python 3.10 and newer, GCC or Clang, and Linux, Windows and macOS. · gcovr.com, 1 Oct 2026
- SonarQube integration
- gcovr can generate SonarQube-compatible XML coverage reports with line, branch, condition, or decision metrics. · gcovr.com, 30 Sept 2026
- Support
- The project directs users to GitHub issue tickets, Stack Overflow and a Gitter chat room for help. · gcovr.com, 1 Oct 2026
- Workflow
- Users compile with GCC coverage flags, run their test suite, and invoke gcovr to generate a tabular report. · gcovr.com, 30 Sept 2026
Where gcovr stands on Freedom251
- Test Coverage Tools#15 of 27