[dmd-internals] dmd test suite coverage

Walter Bright walter at digitalmars.com
Mon Sep 6 13:19:15 PDT 2010



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.


More information about the dmd-internals mailing list