[Issue 14855] -cov should ignore assert(0)

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Aug 7 16:52:18 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=14855

--- Comment #5 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
> Maybe we can add a compiler flag or API in Druntime to change the behavior based on a user's opinion?

Much as I would love to see assert(0) not counted towards the coverage, I think
that we should avoid extra compiler flags for stuff like this, and Walter is
generally opposed to adding compiler flags without a really good reason, so I'd
be pretty shocked if he'd agree to one for this. If he were convinced that it
mattered enough to consider it, he'd just agree to change the normal behavior.

At this point, expect that the options are:

1. Just put up with how things are and fail to get 100% code coverage in a
number of cases because of this issue.

2. Someone other than Walter implements it (which is often the case with
compiler changes anyway). While he may not think that it's worth doing himself,
he may not be opposed enough to the idea to block it if someone else did the
work. If I worked on the compiler normally, I'd probably just make the change
and see if I could get it through, but what little time I have for working on
official D stuff goes towards the standard library.

3. Use a different code coverage tool. I don't know how possible that would be
with dmd, but it should work with gdc or ldc.

4. Write a tool for tweaking the code coverage results from dmd to work around
corner cases like this that Walter doesn't think should be fixed. It does seem
kind of icky to massage the results like that, but it would provide a way to
work around the problem.

--


More information about the Digitalmars-d-bugs mailing list