Closed davidhewitt closed 3 years ago
Probably we can support this by adding a flag like --no-report that does the opposite of --no-run, and combining the two.
cargo llvm-cov --no-report --features a
cargo llvm-cov --no-report --features b
cargo llvm-cov --no-run --lcov
That sounds ideal. I'm happy to offer a PR to add --no-report
if that's helpful? I haven't looked at the code, but skipping the report step doesn't sound too hard to implement 😅
Perhaps the hardest bit is that --no-report
may want to avoid cleaning up any existing profiling output? (Assuming that cargo-llvm-cov
usually cleans up some output directory before running...?)
I'm happy to offer a PR to add
--no-report
That would be great!
Perhaps the hardest bit is that
--no-report
may want to avoid cleaning up any existing profiling output? (Assuming thatcargo-llvm-cov
usually cleans up some output directory before running...?)
Perhaps we can separate the step of cleaning the artifacts, the step of running the tests, and the step of generating the report into separate functions, and combine them.
--no-run
, only generate the report.--no-report
, only run the tests.We might be able to add some heuristics for artifact cleanup in --no-report
, but for now, I think it's okay to always require explicit cargo clean
.
I will probably do this together with some other refactoring.
Ok 👍
I did indeed hope to write this PR, but my time is spread super thin right now so I was expecting I wouldn't get to it before next week. Thank you for all the work on cargo-llvm-cov
, it's really improved how we measure coverage in PyO3!
PyO3 has a feature (
--multiple-pymethods
) which alters several code paths (such as inside a proc macro crate, the feature causes different generated code to be emitted).Ideally I'd like to measure coverage combined from runs with and without this feature enabled. It's not immediately clear to me whether this is possible with
cargo-llvm-cov
at the moment. Do you think that's something which would make sense to support?At the moment PyO3's CI just makes several different invocations to
cargo test
and then runsgrcov
once at the end.I expect it's possible I could find an external tool to merge lcov output files for now, rather than making this a part of
cargo-llvm-cov
.