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

Exclude tag does not work properly on packages with both main.rs and lib.rs #339

Open GunnarMorrigan opened 5 months ago

GunnarMorrigan commented 5 months ago

Performing cargo llvm-cov test on a workspace with excluded packages does not properly exclude packages with both main.rs and lib.rs.

The command: The html output of cargo llvm-cov test --workspace --exclude example_a --html will include example_a regardless. Here example_a is a package containing both a main.rs and a lib.rs.

If I rename lib.rs in example_a I get the following error:

error: C:\...\example_a\src\lib.rs: no such file or directory
warning: The file 'C:\...\example_a\src\lib.rs' isn't covered.

This indicates that the exclude is not properly applied or I am using it wrong.

taiki-e commented 5 months ago

Thanks for the report! It looks like there is some kind of problem with the path handling in Windows.

Could you provide an example that can reproduce the problem?

GunnarMorrigan commented 5 months ago

Hi,

Thank you for creating such a cool tool!

I haven't been able to recreate the problem minimally. I will keep trying tho! Additionally, I have checked all package names and folders if they match up with the exclude tag but haven't found a problem so far. I might try fork llvm and print some debug info and see where it goes wrong.

Hope i have the time for this on the short term