Advanced code coverage analysis

Walter Bright newshound2 at digitalmars.com
Wed Dec 6 03:15:38 UTC 2017


On 12/5/2017 2:55 AM, Basile B. wrote:
> On Monday, 4 December 2017 at 20:33:56 UTC, thinwybk wrote:
>> Hi everyone,
>>
>> as far as I know there is a statement coverage analyzer built into DMD 
>> https://dlang.org/code_coverage.html . Are there code coverage analyzers for D 
>> which support branch coverage and other more advanced coverage metrics 
>> https://en.wikipedia.org/wiki/Code_coverage ?
>>
>> Cheers,
>> thinwybk
> 
> No, the compiler reports only statement coverage. Higher levels reports could be 
> made by a tool that would use the LST file and the AST produced by libdparse.

The wiki lists function coverage, statement coverage, branch coverage, and 
condition coverage. The builtin coverage analyzer does all of them.

However, if you put multiple statements, conditions, etc., on one line, you'll 
get the sum of the usage counts.


More information about the Digitalmars-d mailing list