cargo-llvm-cov vs Microsoft Code Coverage
cargo-llvm-cov
github.comMicrosoft Code Coverage
github.comSide by side
| Figure | cargo-llvm-cov | Microsoft Code Coverage |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Plans published | 1 | 1 |
| Spec score · Test Coverage Tools | 8.1 (#8) | 7.5 (#18) |
| Purpose | cargo-llvm-cov is a Cargo subcommand that wraps rustc’s LLVM source-based code coverage instrumentation. | Measures what proportion of a project's code is exercised by coded tests such as unit tests. |
| Report formats | Coverage reports can be generated as text, HTML, JSON, LCOV, Cobertura XML, or Codecov Custom Coverage format. | The MTP coverage extension supports coverage, XML, and Cobertura output formats. |
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.
Microsoft Code Coverage
Microsoft Code Coverage measures how much of a project’s code is exercised by coded tests, such as unit tests. Its documented workflows cover.NET test projects with `dotnet test` and other.NET applications with the `dotnet-coverage` tool. It analyzes managed CLR and unmanaged native code using static or dynamic instrumentation; native coverage is disabled by default in the MTP extension. With Microsoft.Testing.Platform.MSBuild, extensions are auto-registered with MSTest, NUnit, and xUnit runners. The MTP extension can produce coverage, XML, and Cobertura reports, with settings for output, inclusion and exclusion rules, and instrumentation. It runs on Windows, macOS, and multiple Linux distributions, though instrumentation support varies by OS, version, and architecture. Other operating systems are supported on a best-effort basis, and some combinations allow static instrumentation only. Dynamic instrumentation on macOS and Linux requires libxml2, and missing dependencies may leave a report empty. MTP also excludes test assemblies by default unless configured otherwise. The plan is free.