taiki-e / cargo-llvm-cov

Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Apache License 2.0
858 stars 57 forks source link

Add unstable --dep-coverage option #353

Closed taiki-e closed 3 months ago

taiki-e commented 3 months ago

By default, cargo-llvm-cov only shows coverage of crates in the workspace.

This can be disabled by --disable-default-ignore-filename-regex flag. However, in this case, coverage of crates and all dependencies in the workspace will be shown.

disable-default-ignore-filename-regex

If you specify a dependency with the --dep-coverage option that this PR adds, only the coverage of that dependency will be shown. The following is using --dep-coverage memchr:

dep-coverage

The option is currently marked as unstable due to limitations such as not yet being able to show coverage other than dependencies from crates.io.

cc @xizheyin

xizheyin commented 3 months ago

Thank you very much! I was going to use a script for this, but I didn't expect to implement this feature so quickly!

davidzeng0 commented 3 months ago

there is a typo

        --dep-coverage <NAME>
            Show coverage of th specified dependency instead of the crates in the current workspace. (unstable)
taiki-e commented 3 months ago

@davidzeng0 Good catch! Fixed in 14904585689e91f96e3610bbabc47f57d7063670.