cargo-llvm-cov
github.com
- Free plan
- Windows
- macOS
- Linux
What cargo-llvm-cov is
cargo-llvm-cov is a Cargo subcommand that uses rustc’s LLVM source-based instrumentation to generate code coverage reports. It supports cargo test, cargo run, and cargo nextest, along with proc-macro UI tests. Line and region coverage are available; branch coverage is optional and requires nightly Rust. Doc-test coverage is also optional and needs nightly features. Reports can be produced as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. The project includes GitHub Actions examples for sending reports to Codecov and a GitLab CI example using Cobertura output. LCOV output can appear in VS Code with the Coverage Gutters extension. With compatible Clang and LLVM tools configured, coverage can include C and C++ code linked to a Rust library or binary. The project is free and open source under either Apache-2.0 or MIT. Installing requires rustc 1.87 or newer, and running it requires Cargo 1.60 or newer. Releases are described as immutable, and releases since 0.8.5 publish artifact attestations with verification commands documented.
Who it suits
It suits Rust developers who want coverage reports in local or CI workflows, including projects with linked C or C++ code when compatible Clang and LLVM tools are configured. Teams needing branch or doc-test coverage should account for the nightly requirements and known issues.
Good to know, and what to watch
- Supports cargo test, cargo run, and cargo nextest.
- Generates reports in six listed formats.
- Provides GitHub Actions and GitLab CI examples.
- LCOV output works with Coverage Gutters in VS Code.
- Free and open source under Apache-2.0 or MIT.
- Branch coverage requires nightly Rust.
- Doc-test coverage needs nightly features and has known issues.
- Installation requires rustc 1.87 or newer.
- Running requires Cargo 1.60 or newer.
Plans
Every plan and priceFree / open source
Open source
Getting started
- Open the cargo-llvm-cov GitHub repository
- Install it from Cargo source, a prebuilt binary, or a listed package route
- Ensure rustc 1.87 or newer is installed
- Use Cargo 1.60 or newer to run it
- Run it with cargo test, cargo run, or cargo nextest
- Select a text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage report
Limits to check
Branch coverage requires nightly Rust and is described as unstable. Doc-test coverage is optional, requires nightly features, and has known issues.
The verdict
cargo-llvm-cov offers Rust-focused coverage with several report formats and CI examples. Nightly requirements and known instability matter for teams relying on branch or doc-test coverage.
Questions people ask
Is cargo-llvm-cov free?
Yes. It is free and open source, with Apache-2.0 or MIT licensing and no paid plans stated.
Which operating systems are supported?
Linux, macOS, and Windows are supported. Prebuilt binaries are also listed for FreeBSD.
What coverage can it generate?
It generates line and region coverage. Branch coverage is optional and currently requires nightly Rust.
Which report formats are available?
Reports can be text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format.
What Rust versions are required?
Installation currently requires rustc 1.87 or newer, and running the tool requires Cargo 1.60 or newer.
Can it cover C and C++ code?
Yes, when compatible Clang and LLVM tools are configured, it can include C or C++ code linked to a Rust library or binary.
What the maker publishes
- CI integrations
- The README provides GitHub Actions examples for uploading reports to Codecov and a GitLab CI example using Cobertura output. source
- Coverage types
- It generates line and region coverage, while branch coverage is optional and currently requires nightly Rust. source
- Editor integration
- LCOV output can be displayed in VS Code using the Coverage Gutters extension. source
- 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. source
- Known limitations
- Branch coverage is unstable, and doc-test coverage is unstable and has known issues. source
- License
- The project is available under either the Apache License 2.0 or the MIT License, at the user's option. source
- 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. source
- 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. source
- Purpose
- cargo-llvm-cov is a Cargo subcommand that wraps rustc’s LLVM source-based code coverage instrumentation. source
- Report formats
- Coverage reports can be generated as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. source
- Requirements
- Installing currently requires rustc 1.87 or newer, while running it requires Cargo 1.60 or newer. source
- Rust test support
- It supports proc-macro UI tests and doc tests, though doc-test coverage is optional and requires nightly features. source
- 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. source
- Test runners
- It supports cargo test, cargo run, and cargo nextest through a Cargo-compatible command-line interface. source
Checked against the maker's pages on 8 Oct 2026.