[dmd-internals] dmd test suite coverage

Don Clugston dclugston at googlemail.com
Mon Sep 6 13:33:48 PDT 2010


On 6 September 2010 22:19, Walter Bright <walter at digitalmars.com> wrote:
>
>
> Don Clugston wrote:
>>
>> On 3 September 2010 23:48, Walter Bright <walter at digitalmars.com> wrote:
>>
>>>
>>> I built dmd with coverage analysis (gcov on linux) and ran the test
>>> suite.
>>> This is one of the result files - there are definitely gaps in the suite.
>>>
>>
>> There were some very large gaps in interpret.c.
>> This isn't entirely a test suite issue, though -- there's a big block
>> of unreachable code. ForeachStatement::interpret() and
>> ForeachRangeStatement::interpret() should be completely deleted. Like
>> 'while', they are turned into 'for' in the semantic pass.
>> I've made a few tests for the other major gaps. This is by no means
>> comprehensive, but it should nearly halve the number of uncovered
>> lines.
>>
>> Add these tests to the end of interpret3.d
>>
>>
>
> Thanks, done. I agree the unreachable code should be deleted or #ifdef'd
> out. One thing a coverage analyzer is good at is identifying unreachable
> cruft.

Yes. Some of the coverage results are really interesting.
Actually, I find coverage is fantastic for debugging, as well.
How painful would it be to get a -cov dmd build on Windows?


More information about the dmd-internals mailing list