Fix issue 19163: don't count declarations in coverage analysis#8997
Conversation
|
Thanks for your pull request and interest in making D better, @FeepingCreature! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "stable + dmd#8997" |
|
Is there any way we can test this? |
|
From looking at the test suite, not easily. Would have to make a script to check the generated |
|
This is an enhancement, please target master. |
|
It's not a new feature or new functionality, it's a correction of an error in existing functionality. Lines of code that have no runtime behavior should not have coverage. |
Have a look at the existing tests. You basically start with a shell script, invoke the compiler there, then compare the two files with diff. There are a few environment variables that can by used to set e.g. the output directory to the one of the testsuite. |
4ca5589 to
1e5d581
Compare
|
|
|
I'm reasonably sure it's spurious. |
|
Hmm, I hesitant to pull with such a critical piece of infrastructure failing, I restarted it once already and it failed again. |
|
I'm not sure how I could logically be responsible for "Package dub not found for registry at https://code.dlang.org/". Try restarting another PR. You should get this error everywhere. |
|
Maybe it is a |
|
The dub interactive remove test has been fixed, but the latest tag (1.12.0) doesn't contain the fix. Compare: |
|
Auto-merge toggled on |
|
Actually, I think it waits for the commit to be merged to master. |
|
yay |
Yup. |
Consider this code:
When run with
dmd -cov -run test.d, thealias,enumandstatic foreachare given coverage counts of 0, despite the fact that they contain no executable code.This PR fixes that, by only counting coverage for expressions that actually do work at runtime.