Bug 14790 – coverage merge should detect changed source code
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-07-09T12:27:09Z
Last change time
2021-01-27T02:33:01Z
Keywords
pull
Assigned to
No Owner
Creator
Martin Nowak
Comments
Comment #0 by code — 2015-07-09T12:27:09Z
Just to not merge numbers from different versions of the same source file.
Could be implemented very simply by storing a hash/modtime of the source somewhere in the coverage report (e.g. on the first/last line).
Comment #1 by dlang-bugzilla — 2017-07-21T08:30:52Z
Why not just compare the modification time of the source file with that of the existing coverage file? That would be simpler, and allow avoiding changing the format of the coverage file.
Comment #2 by dlang-bot — 2021-01-23T17:08:25Z
@ljmf00 created dlang/druntime pull request #3341 "Fix Issue 14790: rt: cover: coverage merge should detect changed source code" fixing this issue:
- Fix Issue 14790: rt: cover: coverage merge should detect changed source code
Merging different versions of the same source file could lead to mismatched
covered lines if the source code actually changes. Changing the .lst file
format will open a huge breaking change and rely on timestamps is impractical.
As an alternative to this, we can deeply compare the source code with generated
.lst which also has a copy of the original source code.
Signed-off-by: Luís Ferreira <[email protected]>
https://github.com/dlang/druntime/pull/3341
Comment #3 by dlang-bot — 2021-01-27T02:33:01Z
dlang/druntime pull request #3341 "Fix Issue 14790: rt: cover: coverage merge should detect changed source code" was merged into master:
- 6c7dc69cbe777eb5a8df20afc99220a1dcf0ae09 by Luís Ferreira:
Fix Issue 14790: rt: cover: coverage merge should detect changed source code
Merging different versions of the same source file could lead to mismatched
covered lines if the source code actually changes. Changing the .lst file
format will open a huge breaking change and rely on timestamps is impractical.
As an alternative to this, we can deeply compare the source code with generated
.lst which also has a copy of the original source code.
Signed-off-by: Luís Ferreira <[email protected]>
https://github.com/dlang/druntime/pull/3341