cargo-llvm-cov vs Coverage.py
cargo-llvm-cov
github.comCoverage.py
coverage.readthedocs.ioSide by side
| Figure | cargo-llvm-cov | Coverage.py |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | Yes |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| API | — | Yes |
| Self-hosted | — | Yes |
| Plans published | 1 | 2 |
| Spec score · Test Coverage Tools | 8.1 (#8) | 8.9 (#2) |
| Coverage types | It generates line and region coverage, while branch coverage is optional and currently requires nightly Rust. | It measures statement coverage by default and can also measure branch coverage. |
| 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. | The documented installation command is `python3 -m pip install coverage`. |
| License | The project is available under either the Apache License 2.0 or the MIT License, at the user's option. | Coverage.py is licensed under the Apache 2.0 License. |
| Purpose | cargo-llvm-cov is a Cargo subcommand that wraps rustc’s LLVM source-based code coverage instrumentation. | Coverage.py measures which parts of Python programs ran and identifies executable code that did not run, commonly to gauge test effectiveness. |
| Report formats | Coverage reports can be generated as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. | Reports can be emitted as text, HTML, XML, LCOV, or JSON. |
Plans
In their own words
cargo-llvm-cov
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.
Coverage.py
Coverage.py measures which parts of Python programs run and highlights executable code that remains untouched, helping developers assess what their tests exercise. It measures statement coverage by default and can also track branch coverage. Reports are available as text, HTML, XML, LCOV, and JSON. Dynamic contexts can associate lines of execution with the test function that ran them. Coverage.py can run test suites through their usual command; pytest-cov is available but the documentation says most users do not need it. Third-party plugins can extend measurement to non-Python files, such as connecting executed Python to Django templates. Data is stored in a SQLite database, and advanced use can rely on its API. The current documentation lists Python 3.10 through 3.15 rc2 and PyPy3 versions 3.10 and 3.11. The tool provides ctrace, pytrace, and sysmon measurement cores; sysmon is faster for simple line and branch coverage but lacks support for dynamic contexts and plugins. Coverage.py is licensed under Apache 2.0 and runs on Linux, macOS, and Windows, with self-hosting available. It is free.