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

warning: N functions have mismatched data #329

Open mattgathu opened 6 months ago

mattgathu commented 6 months ago

Hello 👋🏾

I'm running some coverage check locally and I got a warning about mismatched data.

❯ cargo llvm-cov --open

running 5 tests
test mime::tests::check_mime_str ... ok
...

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

warning: 1 functions have mismatched data

How can I find out the function with mismatched data?

I tried running in verbose mode but it didn't help.

Thanks

taiki-e commented 3 months ago

There is no way to show the affected code at this time, but the warning here probably has been fixed in v0.6.7 (https://github.com/taiki-e/cargo-llvm-cov/pull/354). Could you recheck this with v0.6.7?

0xisk commented 3 months ago

Hey! thanks first of all for this nice tool. I have the same issue here after running:

cargo llvm-cov --all-features --workspace --html --output-dir=target/llvm-cov/html 

Error:

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 89.12s

warning: 4 functions have mismatched data

    Finished report saved to target/llvm-cov/html/html

I am using the recent version.

cargo llvm-cov --version                                                                            
cargo-llvm-cov 0.6.7

Thanks!

Dushistov commented 1 week ago

The same issue with cargo-llvm-cov 0.6.10 and rustc 1.78.0 (9b00956e5 2024-04-29)

------------
     Summary [ 260.019s] 188 tests run: 188 passed (14 slow), 1 skipped
warning: 30 functions have mismatched data

I will try to create reproducible example in this weekend.

Michael-J-Ward commented 1 week ago

I encountered this warning while trying to add code coverage to a rust-pyo3 project.

Here is a minimum reproducible example with a flake devshell and run script provided for convenience. https://github.com/Michael-J-Ward/rust-python-coverage

❯ cargo --version
cargo 1.81.0-nightly (4ed7bee47 2024-06-25)

❯ rustc --version
rustc 1.81.0-nightly (4bc39f028 2024-06-26)

❯ cargo llvm-cov --version
cargo-llvm-cov 0.6.10