EVERYTHING XIAOMI
Get listed

gcov

gcov is a free coverage tool used with GCC to show which parts of a program execute during testing.

Place
#6 of 27
Score
6.5
gcov's website

What gcov is

gcov is a free coverage tool used with GCC to show which parts of a program execute during testing. It reports line execution counts and can produce line, function, branch, condition, prime-path, and basic-block coverage information. Developers can filter reports to functions matching regular expressions with the `--include` and `--exclude` options. Output is available as `.gcov` text or compressed JSON; the JSON format is gzip-compressed and does not require source code to generate. gcov writes coverage files for source files containing code compiled to produce the data. Its documentation also describes using it with gprof to examine computing time, while noting that optimization can combine source lines and reduce detail for finding performance hotspots. The companion gcov-tool can merge and adjust profile counts offline, and gcov-dump can inspect profile files. Programs must be compiled with GCC’s `--coverage` option before gcov can process coverage data. It works only with GCC-compiled code and is not compatible with other profiling or test coverage mechanisms. gcov supports Linux, macOS, and Windows.

Good

  • Reports line, function, branch, condition, and path coverage.
  • Provides text and compressed JSON output.
  • Can filter reports by function-name expressions.
  • Companion tools can merge or inspect profile data.

Watch out

  • Requires programs compiled with GCC’s `--coverage` option.
  • Works only with GCC-compiled code.
  • Not compatible with other profiling or coverage mechanisms.
  • Optimization may reduce detail for performance hotspot analysis.

Who it suits

gcov is for developers using GCC who want coverage information alongside test suites to find areas needing more tests. It can also help investigate execution time with gprof.

Verdict

gcov supplies several coverage views for GCC-compiled programs and can produce machine-readable reports. Its GCC-only instrumentation requirement is central to deciding whether it fits a project.

Plans and prices

From gcov's own pricing page, checked 7 Oct 2026.

All about pricing
PlanPriceWhat it gives you
gcovFreeRequires code compiled with GCC; requires coverage instrumentation to generate coverage data

The facts

Each one read from gcov's own pages, with the date it was checked.

What it does

Branch coverage
The --branch-probabilities option reports branch frequencies in the output file and branch summary information on standard output.checked 7 Oct 2026
Compatibility limit
gcov works only on code compiled with GCC and is not compatible with other profiling or test coverage mechanisms.checked 7 Oct 2026
Compiler compatibility
gcov works only on code compiled with GCC and is not compatible with other profiling or test coverage mechanisms.checked 7 Oct 2026
Condition coverage
The --conditions option reports whether conditions independently affected the outcome of a Boolean expression.checked 7 Oct 2026
Coverage modes
Its options include branch, condition, and prime-path coverage reporting.checked 7 Oct 2026
Distribution
GCC source releases are distributed through mirror sites and source can also be retrieved using Git.checked 7 Oct 2026
Instrumentation requirement
Programs must be compiled with GCC's --coverage option before gcov can process the generated profiling data.checked 7 Oct 2026
Intended users
The documentation describes software developers using coverage results with test suites to find where additional tests are needed.checked 7 Oct 2026
Line coverage
gcov reports how often each source line executes and creates a .gcov logfile with per-line execution counts.checked 7 Oct 2026
Line statistics
gcov reports how often each line executes and which lines are executed.checked 7 Oct 2026
Optimization caveat
The documentation says optimization can combine source lines and reduce the information available for finding performance hotspots.checked 7 Oct 2026
Output files
gcov produces coverage output files for source files containing code compiled to produce the data files.checked 7 Oct 2026
Profile inspection
The companion gcov-dump can dump the contents of gcda and gcno profile files offline.checked 7 Oct 2026
Profile processing
The companion gcov-tool can merge weighted profile sets, merge streamed profiles, and scale or normalize profile counts offline.checked 7 Oct 2026
Profiling
The documentation describes using gcov with gprof to assess computing time and fine-tune performance.checked 7 Oct 2026
Project status
The GCC homepage listed GCC 16.2 as released on August 7, 2026 and GCC 17.0 as in development.checked 7 Oct 2026
Purpose
gcov is a test coverage program used with GCC to find untested parts of programs and guide code optimization.checked 7 Oct 2026
Reporting filters
The --include and --exclude options let users limit reports to functions matching specified regular expressions.checked 7 Oct 2026
Setup requirement
Programs must be compiled with GCC's --coverage option before gcov can report coverage.checked 7 Oct 2026
Support
The GCC project directs users to its manuals and the gcc-help mailing list for usage questions.checked 7 Oct 2026
Use cases
It can help identify untested parts of a program and guide code optimization.checked 7 Oct 2026
Use with gprof
gcov can be used alongside gprof to assess which parts of a program use the most computing time.checked 7 Oct 2026

The company

Founded
1987checked 28 Sep 2026

Where it runs

Machine-readable output
The --json-format option produces gzip-compressed JSON output that does not require source code to generate.checked 7 Oct 2026
The full review of gcov

Overview

gcov is a free coverage utility in the GCC toolchain, aimed at developers using test suites to find code their tests miss. Its strongest case is a GCC-based project that needs detailed coverage reports without a separate paid service; it is not a cross-compiler solution.

Key features

Line reports show execution counts for each source line in a .gcov file, making unvisited code and uneven execution visible. Branch reporting adds branch frequencies and a summary, while condition coverage indicates whether individual conditions affected a Boolean expression’s result. Prime-path and basic-block coverage provide further ways to examine execution. This breadth helps teams investigate more than whether a line ran, but only when the program was compiled with GCC’s --coverage option.

The --json-format option emits gzip-compressed JSON that does not require source code to generate, a useful fit for automated processing. Include and exclude filters narrow reports to functions matching regular expressions, helping focus output on selected parts of a project. gcov can be paired with gprof to examine computing time, though optimization may combine source lines and make hotspots harder to pinpoint. The companion gcov-tool merges weighted or streamed profiles and scales or normalizes counts offline; gcov-dump inspects gcda and gcno files.

Pricing

gcov costs nothing, with no paid plan or trial. The free plan is the tool itself, but it is useful only with GCC-compiled programs instrumented to generate coverage data. There are no stated seat or usage caps. For projects already using GCC, the absence of a separate coverage-tool charge is a clear advantage; the tool’s compiler restriction, rather than a tier limit, is the meaningful trade-off.

Platforms

gcov is available on Linux, macOS, and Windows. It supports C, C++, Objective-C, Objective-C++, Fortran, Ada, D, and Go when compiled with GCC. Reports are available as .gcov text or compressed JSON.

Who it's for

gcov is best for developers whose GCC-based test workflow needs line, branch, condition, or path coverage to guide additional testing. It can also help identify execution patterns relevant to optimization, with the caveat that optimization may reduce the source-level detail available for locating performance hotspots. Teams that need coverage across non-GCC builds should look elsewhere: gcov does not work with code compiled by other compilers or with other profiling and coverage mechanisms.

Pros and cons

  • Pros: Free coverage reporting spans line, function, branch, condition, prime-path, and basic-block views, giving GCC users more than a simple line tally.
  • Pros: Compressed JSON output and regular-expression filters support focused, machine-readable reporting.
  • Pros: Companion utilities handle offline profile merging, scaling, normalization, and inspection.
  • Cons: Projects must be compiled with GCC’s --coverage instrumentation, which rules out coverage across other compiler workflows.
  • Cons: Optimization can combine source lines and make performance hotspots less clear when using gcov alongside gprof.

Alternatives

For open-source and public repositories, Coveralls is worth considering: it is always free for those projects and also offers a free trial, with API, Linux, self-hosted, and web platforms. Choose OpenClover if its stated no-license-tier, no-license-key, and no-usage-limit terms better suit your needs. ReportGenerator offers a 10-day full-access trial and a free open-source tier with basic features, giving readers who want to assess a separate reporting tool a trial path. Ruby projects should consider SimpleCov, a free MIT-licensed Ruby coverage tool. BullseyeCoverage is an alternative with a fully functional but temporary evaluation license. Rust users can consider cargo-llvm-cov, which is free and open source. Python projects can consider Coverage.py, a free open-source Python coverage tool. LLVM llvm-cov is another free coverage tool for readers seeking an LLVM option. Browse the Test Coverage Tools category for more options.

Verdict

Choose gcov if your project already compiles with GCC and you want free, detailed coverage reports to direct testing. Its range of coverage views and machine-readable output make it useful in that workflow; if your builds rely on another compiler or mixed coverage mechanisms, its GCC-only requirement is the decisive reason to choose another tool.

Getting started

  1. Open the GCC gcov documentation website.
  2. Use a Linux, macOS, or Windows environment.
  3. Compile the program with GCC’s --coverage option to generate coverage data.
  4. Run gcov on the generated data to produce coverage reports.

Limits worth knowing

The free plan requires code compiled with GCC and coverage instrumentation to generate coverage data. gcov does not support code compiled with other compilers or other profiling and test coverage mechanisms.

Questions

How much does gcov cost?

The listed plan is free at no cost.

Is there a free plan or trial?

A free plan is listed. There is no free trial.

Which platforms does gcov support?

Linux, macOS, and Windows are listed.

Which programming languages are supported?

Listed languages are C, C++, Objective-C, Objective-C++, Fortran, Ada, D, and Go.

What report formats does gcov produce?

Reports can be .gcov text or compressed JSON (.gcov.json.gz).

Does gcov work with code not compiled by GCC?

No. gcov requires GCC-compiled code and is not compatible with other profiling or test coverage mechanisms.

Alternatives to gcov

All alternatives
  1. 1Codecov logo

    Codecov

    Free planOpen sourceWebAPIExtensionLinux
    8.0From $5 a month
  2. 2

    Avidemux

    Free planOpen sourceWebLinuxmacOSWindows
    7.3Free plan
  3. 3

    Coverage.py

    Free planOpen sourceAPILinuxmacOSSelf-hosted
    7.3Free plan
  4. 4Coveralls logo

    Coveralls

    Free planWebAPILinuxSelf-hosted
    6.8From $10 a month
  5. 5

    ReportGenerator

    Free planLinuxmacOSWindows
    6.8$79 one-time
  6. 6

    OpenClover

    Free planWebLinuxmacOSWindows
    6.4Free plan