D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21119 - Code coverage checker is not instrumenting backend source files
Summary: Code coverage checker is not instrumenting backend source files
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-05 11:01 UTC by Walter Bright
Modified: 2020-08-06 20:23 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2020-08-05 11:01:12 UTC
For example,

https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/cod4.d

shows 0% coverage.
Comment 1 moonlightsentinel 2020-08-06 11:37:45 UTC
Probably because the backend is compiled with `-betterC` which apparently breaks `-cov`.
Comment 2 Dlang Bot 2020-08-06 12:01:47 UTC
@MoonlightSentinel created dlang/dmd pull request #11522 "Workaround for Issue 21119 - Disable -betterC for coverage builds" mentioning this issue:

- Workaround for Issue 21119 - Disable -betterC for coverage builds
  
  because -betterC apparently breaks coverage generation

https://github.com/dlang/dmd/pull/11522
Comment 3 Dlang Bot 2020-08-06 19:43:55 UTC
dlang/dmd pull request #11522 "Workaround for Issue 21119 - Disable -betterC for coverage builds" was merged into master:

- ceb3cc976f1968d83a2f91112b30bd2a9d0ba647 by MoonlightSentinel:
  Workaround for Issue 21119 - Disable -betterC for coverage builds
  
  because `-betterC` apparently breaks coverage generation

https://github.com/dlang/dmd/pull/11522
Comment 4 Walter Bright 2020-08-06 20:22:40 UTC
-cov requires linking with druntime, and -betterC explicitly must not require druntime. This is not a bug in the backend.
Comment 5 Walter Bright 2020-08-06 20:23:43 UTC
Working now.