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 support for specifying arbitrary `--object`s #367

Open rcoh opened 2 months ago

rcoh commented 2 months ago

I recently added coverage testing for duchess which has a somewhat complicated setup of regular unit tests & and subproject containing ui tests.

This meant I had to go manually pick up all of the --object invocations that were needed which (I think) made it impossible to use cargo llvm-cov. Ideally, I'd be able to use a combination of https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#get-coverage-of-external-tests and this additional configuration behavior to be able to use this tool directly.

Is there a better way of doing this that would have meant I could have used cargo llvm-cov directly without changes? Or is some sort of additional configuration required.

taiki-e commented 2 months ago

I think you can use LLVM_COV_FLAGS environment-variable, but I'm okay with adding a specific option for out-of-target-dir object files.