diffutils icon indicating copy to clipboard operation
diffutils copied to clipboard

Use the instrumentation-based code coverage implementation

Open oSoMoN opened this issue 1 year ago • 3 comments

~~This requires more work to figure out why the generated reports are unusable.~~

EDIT: fixed

oSoMoN avatar Apr 30 '24 22:04 oSoMoN

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.12%. Comparing base (b815162) to head (dbabf39). Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
- Coverage   82.01%   81.12%   -0.89%     
==========================================
  Files          10       10              
  Lines        3013     4227    +1214     
  Branches      753      403     -350     
==========================================
+ Hits         2471     3429     +958     
- Misses        513      778     +265     
+ Partials       29       20       -9     
Flag Coverage Δ
macos_latest 81.23% <ø> (-1.63%) :arrow_down:
ubuntu_latest 81.42% <ø> (+5.69%) :arrow_up:
windows_latest 20.41% <ø> (+4.52%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 10 '24 10:08 codecov[bot]

Generated reports are now correct and usable on unix and macos, but running cargo test with -Cinstrument-coverage on windows now fail:

process didn't exit successfully: `D:\a\diffutils\diffutils\target\debug\deps\diffutilslib-a04822fa61f6982e.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

This requires further investigation, but the results on unix/macos are already quite promising.

oSoMoN avatar Aug 10 '24 11:08 oSoMoN

Removing -Clink-dead-code from $RUSTFLAGS results in the tests passing on Windows.

This looks very similar to rust-lang/rust#76038. An old comment on that issue claims that:

-Clink-dead-code is no longer required or recommended when enabling coverage instrumentation

So let's just go with it!

oSoMoN avatar Aug 15 '24 22:08 oSoMoN