cargo-llvm-cov
github.com
What it is
cargo-llvm-cov is a Cargo subcommand that uses rustc’s LLVM source-based instrumentation to generate code coverage reports. It works with cargo test, cargo run, and cargo nextest through a Cargo-compatible command-line interface, and supports 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 requires nightly features. Reports can be generated as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. The project provides GitHub Actions examples for uploading reports to Codecov and a GitLab CI example using Cobertura output. LCOV results can be viewed in VS Code with the Coverage Gutters extension. With compatible Clang and LLVM tools configured, the tool can include C and C++ code linked to a Rust library or binary. It supports Linux, macOS, and Windows, and is licensed under either Apache-2.0 or MIT at the user's choice. Installation requires rustc 1.87 or newer, while running it requires Cargo 1.60 or newer. Branch and doc-test coverage are unstable and have known issues, respectively.
Spec sheet
- Purpose
- cargo-llvm-cov is a Cargo subcommand that wraps rustc’s LLVM source-based code coverage instrumentation.Read 8 Oct 2026 · github.com
- License
- The project is available under either the Apache License 2.0 or the MIT License, at the user's option.Read 8 Oct 2026 · github.com
- CI integrations
- The README provides GitHub Actions examples for uploading reports to Codecov and a GitLab CI example using Cobertura output.Read 8 Oct 2026 · github.com
- Coverage types
- It generates line and region coverage, while branch coverage is optional and currently requires nightly Rust.Read 8 Oct 2026 · github.com
- Editor integration
- LCOV output can be displayed in VS Code using the Coverage Gutters extension.Read 8 Oct 2026 · github.com
- 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.Read 8 Oct 2026 · github.com
- Known limitations
- Branch coverage is unstable, and doc-test coverage is unstable and has known issues.Read 8 Oct 2026 · github.com
- 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.Read 8 Oct 2026 · github.com
- 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.Read 8 Oct 2026 · github.com
- Report formats
- Coverage reports can be generated as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format.Read 8 Oct 2026 · github.com
- Requirements
- Installing currently requires rustc 1.87 or newer, while running it requires Cargo 1.60 or newer.Read 8 Oct 2026 · github.com
- Rust test support
- It supports proc-macro UI tests and doc tests, though doc-test coverage is optional and requires nightly features.Read 8 Oct 2026 · github.com
- 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.Read 8 Oct 2026 · github.com
- Test runners
- It supports cargo test, cargo run, and cargo nextest through a Cargo-compatible command-line interface.Read 8 Oct 2026 · github.com
Plans and prices
Strong points and limits
Strong points
- Works with cargo test, cargo run, and cargo nextest.
- Produces six listed report formats.
- Includes GitHub Actions and GitLab CI examples.
- Can cover linked C and C++ code with compatible tools.
- Free under Apache-2.0 or MIT.
Limits
- Installation requires rustc 1.87 or newer.
- Branch coverage requires nightly Rust.
- Doc-test coverage requires nightly features and has known issues.
Who it suits
It suits Rust developers who want coverage reports in a command-line workflow, including CI pipelines. Projects linking C or C++ code can include that code when compatible Clang and LLVM tools are configured.
Verdict
cargo-llvm-cov offers multiple coverage outputs and test-runner options for Rust projects, with a path to linked C and C++ coverage. Nightly requirements and known coverage limitations matter when selecting which reports to rely on.
Where Specifiction places it
- Test Coverage Tools#8 of 278.1