Strange dmd -cov bug

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Nov 27 09:33:27 PST 2013


On Wed, Nov 27, 2013 at 07:23:26AM -0800, H. S. Teoh wrote:
> I'm seeing a very strange bug with dmd -cov. I started using -cov
> yesterday and looking at the .lst files in order to improve unittest
> coverage in my code, and then I found a block of code that displayed
> 000000 in the .lst file, yet there's a unittest that directly triggers
> it!
> 
> In order to prove that the code actually ran, I added writeln's in that
> block of code as well as the accompanying unittest, and sure enough, it
> *did* run, and it did so within that unittest. However, the .lst file
> still shows up with 000000.
> 
> The odd thing is, this only happens when I build the full program; when
> I tried isolating that particular module from the rest of the program,
> the problem went away.
[...]

Finally, I managed to isolate the problem and reduce the code. It turns
out that it has to do with the combination of separate compilation and
template functions being invoked from two different modules:

	https://d.puremagic.com/issues/show_bug.cgi?id=11619

This is pretty bad, as it makes -cov coverage numbers unreliable. :-(


T

-- 
To provoke is to call someone stupid; to argue is to call each other stupid.


More information about the Digitalmars-d mailing list