Freedom251 › Test Coverage Tools
cargo-llvm-cov

What cargo-llvm-cov is
cargo-llvm-cov is a Cargo subcommand for gathering source coverage from Rust code using rustc’s LLVM instrumentation. It works with cargo test, cargo run, and cargo nextest, and can measure line and region coverage. Branch coverage is optional and requires nightly Rust; doc-test coverage is also optional, needs nightly features, and has known issues. Proc-macro UI tests are supported. Reports can be produced as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. With compatible Clang and LLVM tools, it can include C and C++ code linked to a Rust library or binary. GitHub Actions and GitLab CI examples are provided, and LCOV output can be viewed in VS Code with Coverage Gutters. It runs on Linux, macOS, and Windows, with FreeBSD prebuilt binaries also listed. Installation requires rustc 1.87 or newer, while running requires Cargo 1.60 or newer. It is free and open source under Apache-2.0 or MIT.
Who it suits
It suits Rust developers who want coverage reports across tests or CI workflows, including projects linked with C or C++ code. Teams needing branch or doc-test coverage should note those features require nightly Rust.
What it does well
- Supports cargo test, cargo run, and cargo nextest.
- Offers six report formats.
- Can include linked C and C++ code.
- Free and available under Apache-2.0 or MIT.
What to know first
- Installation requires rustc 1.87 or newer.
- Branch coverage requires nightly Rust.
- Doc-test coverage is unstable and has known issues.
Limits
Branch coverage is optional, requires nightly Rust, and is unstable. Doc-test coverage is optional, requires nightly features, and has known issues.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Free / open source | Apache-2.0 or MIT licensed · no paid plans stated | Free |
As github.com lists them, read 8 Oct 2026. The maker's own page has the final word.
Getting started
- Install rustc 1.87 or newer.
- Install cargo-llvm-cov from source with Cargo, a prebuilt release, or a listed package route.
- Run it with Cargo 1.60 or newer.
- Use it with cargo test, cargo run, or cargo nextest.
- Choose a report format such as HTML, LCOV, or Cobertura XML.
Overview
cargo-llvm-cov is a Cargo subcommand for measuring Rust source coverage with rustc’s LLVM instrumentation. It suits Rust teams that want several report formats or need to include linked C and C++ code. Its range is a strength, but branch and doc-test coverage bring nightly requirements and instability.
As a command-line tool, it fits projects that already build and test through Cargo rather than readers looking for a standalone coverage dashboard. Free and open source, it offers broad output options without a paid plan; the trade-off is a Rust toolchain requirement and optional features that are not stable.
Key features
Line and region coverage form the stable core. Branch coverage is optional, requires nightly Rust, and remains unstable, so teams that depend on branch metrics should account for that constraint before adopting it.
It works with cargo test, cargo run, and cargo nextest, and supports proc-macro UI tests. Doc-test coverage is also optional, but requires nightly features and is unstable with known issues; projects relying heavily on doc tests should treat its results cautiously.
Reports can be produced as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. That breadth makes the tool useful across local review and CI workflows: the README includes GitHub Actions examples for Codecov uploads and a GitLab CI example with Cobertura, while LCOV can be displayed in VS Code through Coverage Gutters.
With compatible Clang and LLVM tools configured, cargo-llvm-cov can include C and C++ coverage for code linked to a Rust library or binary. This is useful for mixed-language projects, though it depends on configuring those external tools.
Installation routes include Cargo source builds, prebuilt release binaries, GitHub Actions, Homebrew, Scoop, cargo-binstall, pacman, and FreeBSD ports. Installing requires rustc 1.87 or newer; running requires Cargo 1.60 or newer. Prebuilt binaries are listed for Linux, macOS, Windows, and FreeBSD. Releases are immutable, and releases since 0.8.5 publish artifact attestations with documented verification commands.
Pricing
Free / open source — free. The project is dual-licensed under Apache-2.0 or MIT, at the user's option, with no paid plans stated. That makes it a straightforward fit for individuals and teams seeking Rust coverage without a software subscription; the relevant costs are the toolchain and setup requirements, not a license fee.
Platforms
The software supports Linux, macOS, and Windows, with prebuilt binaries also listed for FreeBSD. Confirmed Windows targets include x86_64 and i686 MSVC, plus x86_64 and aarch64 GNU/LLVM MinGW. A self-hosted option and coverage gates are supported, useful for teams integrating coverage into their own CI processes.
Who it's for
Choose cargo-llvm-cov if your project uses Rust and you want a Cargo-native way to generate coverage for common test runners in several formats. It is particularly well suited to CI pipelines that need LCOV, Cobertura, or Codecov output, and to mixed Rust/C/C++ projects that can configure compatible Clang and LLVM tools.
It is a less comfortable fit when branch coverage or doc-test coverage must be stable: both are optional nightly features, and doc-test coverage has known issues. It also requires a recent rustc to install, so older toolchains may rule it out.
Pros and cons
- Pro: Multiple report formats, including LCOV and Cobertura XML, suit different editor and CI workflows.
- Pro: Support for cargo test, cargo run, and cargo nextest accommodates several common Rust test workflows.
- Pro: Compatible Clang and LLVM configuration can extend coverage to linked C and C++ code.
- Pro: Free, dual-licensed distribution avoids a paid plan requirement.
- Con: Branch coverage requires nightly Rust and remains unstable, limiting its appeal where branch metrics are central.
- Con: Doc-test coverage is unstable, nightly-dependent, and known to have issues.
- Con: Installing requires rustc 1.87 or newer, a hurdle for projects maintaining older toolchains.
Alternatives
Test Coverage Tools is a useful starting point for comparing coverage software across categories. Among the alternatives, the right choice depends chiefly on the language and workflow:
- OpenClover is another free option, with Linux, macOS, web, and Windows platforms and no usage limits or license keys in its free plan.
- SimpleCov is a free, MIT-licensed Ruby code coverage tool; choose it for Ruby rather than Rust.
- BullseyeCoverage offers a fully functional temporary evaluation license; consider it if that evaluation model suits your needs.
- Coverage.py is an open-source Python coverage tool with an enterprise subscription available through Tidelift; it fits Python projects.
- Coveralls is always free for open-source and public repositories, making it an option for those projects.
- Coverlet is a free, MIT-licensed option for modern .NET SDK-style projects.
- EclEmma is a free Eclipse plug-in for Java code coverage.
- gcov is a free alternative when code is compiled with GCC and coverage instrumentation is used to generate data.
Verdict
For Rust teams that want a free Cargo-native coverage tool with flexible reports—and, where configured, coverage of linked C and C++—cargo-llvm-cov is a strong fit. Choose it for that workflow breadth; look elsewhere if stable branch or doc-test coverage is essential, or if your project cannot meet its rustc installation minimum.
Verdict
cargo-llvm-cov provides several coverage and report options for Rust projects, with a route to include linked C and C++ code. Nightly requirements and the rustc installation minimum matter for teams planning to use its optional coverage features.
Questions
Is cargo-llvm-cov free?
Yes. The project is available for free and has no paid plans stated.
What license does it use?
You can use it under either the Apache License 2.0 or the MIT License.
Which operating systems are supported?
It supports Linux, macOS, and Windows. Prebuilt binaries are also listed for FreeBSD.
Which coverage reports can it generate?
Formats include text, HTML, JSON, LCOV, Cobertura XML, and Codecov Custom Coverage.
Does it support branch and doc-test coverage?
Branch coverage is optional and requires nightly Rust. Doc-test coverage is optional, requires nightly features, and has known issues.
What versions of Rust and Cargo are required?
Installing requires rustc 1.87 or newer. Running cargo-llvm-cov requires Cargo 1.60 or newer.
Facts from cargo-llvm-cov's own pages
- CI integrations
- The README provides GitHub Actions examples for uploading reports to Codecov and a GitLab CI example using Cobertura output. · github.com, 8 Oct 2026
- Coverage types
- It generates line and region coverage, while branch coverage is optional and currently requires nightly Rust. · github.com, 8 Oct 2026
- Editor integration
- LCOV output can be displayed in VS Code using the Coverage Gutters extension. · github.com, 8 Oct 2026
- Installation
- It can be installed from source with Cargo, as a prebuilt release binary, through GitHub Actions, Homebrew, Scoop, cargo-binstall, pacman, or FreeBSD ports. · github.com, 8 Oct 2026
- Known limitations
- Branch coverage is unstable, and doc-test coverage is unstable and has known issues. · github.com, 8 Oct 2026
- License
- The project is available under either the Apache License 2.0 or the MIT License, at the user's option. · github.com, 8 Oct 2026
- Other code coverage
- With compatible Clang and LLVM tools configured, it can include coverage for C/C++ code linked to a Rust library or binary. · github.com, 8 Oct 2026
- Platform coverage
- Prebuilt binaries are listed for Linux, macOS, Windows, and FreeBSD; confirmed Windows targets include x86_64 and i686 MSVC and x86_64 and aarch64 GNU/LLVM MinGW. · github.com, 8 Oct 2026
- Purpose
- cargo-llvm-cov is a Cargo subcommand that wraps rustc’s LLVM source-based code coverage instrumentation. · github.com, 8 Oct 2026
- Report formats
- Coverage reports can be generated as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. · github.com, 8 Oct 2026
- Requirements
- Installing currently requires rustc 1.87 or newer, while running it requires Cargo 1.60 or newer. · github.com, 8 Oct 2026
- Rust test support
- It supports proc-macro UI tests and doc tests, though doc-test coverage is optional and requires nightly features. · github.com, 8 Oct 2026
- Security and releases
- The README says releases are immutable and releases since 0.8.5 publish artifact attestations, with commands documented for verifying release and artifact attestations. · github.com, 8 Oct 2026
- Test runners
- It supports cargo test, cargo run, and cargo nextest through a Cargo-compatible command-line interface. · github.com, 8 Oct 2026
Where cargo-llvm-cov stands on Freedom251
- Test Coverage Tools#5 of 27