Skip to content

Src file mapping not working properly with trybuild and proc-macro workspace member  #140

@teoxoy

Description

@teoxoy

When running integration tests (via trybuild) for a proc-macro crate that is a workspace member, the following warning is output:

error: dep/dep/src/lib.rs: No such file or directory
warning: The file 'dep/dep/src/lib.rs' isn't covered.

cmd run:

cargo llvm-cov --workspace --html

The report ends up showing 2 entries for the same src file as seen below

image

You can find a small reproducible sample here: test.tar.gz

This seems to be happening even if trybuild::TestCases::new() is the only thing in the test fn (no calls to pass or compile_fail).
It also seems to work fine if the crate is a normal lib instead of a proc-macro lib.

I wasn't sure if this is an issue with cargo-llvm-cov or trybuild but having tried tarpaulin with success (same setup), I thought it might be an issue with cargo-llvm-cov.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: related to a bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions