taiki-e / cargo-llvm-cov

Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Apache License 2.0
900 stars 57 forks source link

can't find missing line #380

Open jendrikw opened 1 month ago

jendrikw commented 1 month ago

The text and the html report for my project https://github.com/jendrikw/clearurls show that one line in rules.rs is missing coverage, but I can't find it. I tried --show-missing-lines, but that did nothing.

I'm on commit 12f36764 and this is the output I get from running cargo llvm-cov --all-features --show-missing-lines:

info: cargo-llvm-cov currently setting cfg(coverage); you can opt-out it by passing --no-cfg-coverage
   Compiling clearurls v0.0.1 (/home/jendrik/dev/rust/clearurls)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 8.21s
     Running unittests src/lib.rs (target/llvm-cov-target/debug/deps/clearurls-b84d5d7032e5c877)

running 17 tests
test deserialize_utils::tests::test_deserialize_map_as_vec_error ... ok
test tests::test_from_file_invalid_json ... ok
test deserialize_utils::tests::test_deserialize_regex_set_error ... ok
test tests::test_from_invalid_path ... ok
test deserialize_utils::tests::test_deserialize_regex ... ok
test deserialize_utils::tests::test_deserialize_regex_vec_error ... ok
test tests::test_from_str_invalid_json ... ok
test tests::test_from_read_file ... ok
test tests::test_from_read_vec ... ok
test tests::test_from_path ... ok
test tests::test_raw_rules_produce_invalid_url ... ok
test tests::test_referral_marketing_setter ... ok
test tests::test_invalid_redirection ... ok
test tests::test_invalid_urldecode ... ok
test tests::test_remove_fields_from_url_errors ... ok
test tests::test_raw_rules_unchanged ... ok
test tests::test_strip_referral_marketing ... ok

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

     Running tests/test_markdown.rs (target/llvm-cov-target/debug/deps/test_markdown-4a2b43eb5f36c406)

running 1 test
test test_markdown ... ok

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

     Running tests/test_single_url.rs (target/llvm-cov-target/debug/deps/test_single_url-d76fe224866ae094)

running 1 test
test test_single_url ... ok

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

Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
deserialize_utils.rs               49                 2    95.92%          12                 0   100.00%         142                 0   100.00%           0                 0         -
lib.rs                             84                 3    96.43%          16                 0   100.00%         143                 0   100.00%           0                 0         -
rules.rs                           80                 5    93.75%          15                 0   100.00%          88                 1    98.86%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             213                10    95.31%          43                 0   100.00%         373                 1    99.73%           0                 0         -

(Unrelated, but tips on how to identify uncovered regions would also be appreciated)

jendrikw commented 1 month ago

Here is the text output if that's helpful: https://github.com/jendrikw/clearurls/actions/runs/10229901824/job/28304099435

narner90 commented 1 month ago

Having this same exact issue issue, version is llvm version 19.1.0-rust-1.82.0-nightly

taiki-e commented 1 month ago

I feel this is a similar issue with https://github.com/taiki-e/cargo-llvm-cov/issues/324.