Closed smoelius closed 3 years ago
Seems to make sense to have such an option.
Cool. Thanks. I'll try to submit something soon.
Sorry, I just noticed this:
https://github.com/taiki-e/cargo-llvm-cov/blob/5fce8956d921c84e3119302cdc9e4ee006b4445d/src/env.rs#L14-L16
I can still submit a PR if you like. But since what I want can be achieved through CARGO_LLVM_PROFDATA_FLAGS
, maybe adding the option isn't necessary?
I’m fine with either. The environment variable is to allow us to adjust the behavior of llvm-cov and llvm-profdata without changing the source of cargo-llvm-cov. However, if the flag is useful, it would make sense to add it to cargo-llvm-cov itself so that users can use it easily.
OK. I'll still submit the PR then.
Question: I was planning to write at least one test to the effect of:
cargo-llvm-cov
succeeds with --failure-mode=all
Where do you think a test like that should go?
I usually add tests using the following steps:
1. add test crate to tests/fixtures/crates
. (or using existing test crate) example
2. add test to tests/test.rs
that run target/debug/cargo-llvm-cov
executable. example
3. run test. (the resulting coverage will be output to tests/fixtures/coverage-reports
.)
4. if check on stderr or stdout, use stdout_contains or stderr_contains. example
Considering what kind of tests are needed for this feature, something similar to merge or clean_ws test will probably be needed.
Would you consider a PR to pass a
-failure-mode
option tollvm-profdata merge
? https://llvm.org/docs/CommandGuide/llvm-profdata.html#cmdoption-llvm-profdata-merge-failure-mode