www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Coverage report not output if not run from source dir

reply =?UTF-8?B?Ikx1w61z?= Marques" <luis luismarques.eu> writes:
DMD does not seem to generate the code coverage report file if 
the program is not run from the same directory as the source 
file. The documentation does not mention this as a desired 
behavior, so it seems to be a bug, but maybe it is a safeguard?

For instance, this works:

     ~/test$ dmd -cov test.d && ./test
     ~/test$ ls *.lst
     test.lst

This does not output the coverage listing:

     ~/test/sub$ dmd -cov test.d
     ~/test/sub$ cd ..
     ~/test$ ./sub/test.d
     ~/test$ find . -name '*.lst'
     ~/test$

This attempt at a workaround works, but produces unhelpful 
listing filenames:

     ~/test/sub2$ dmd -cov ../sub1/test.d -of../sub1/test
     ~/test/sub2$ ../sub1/test
     ~/test/sub2$ ls *.lst
     zsh: no matches found: *.lst
     ~/test/sub2$ find . -name '*.lst'
     ./..-sub1-test.lst

So even either:

1) the safeguard is intended (but apparently not documented, 
which should be fixed), but the output path should to be tweaked 
for this latter corner case;

2) this is all a bug, and the coverage listing is missing when it 
shouldn't.

I just wanted to clarify which. I can open a bug report after 
clarifying.

In the future, should I just file bug reports and ask any 
questions there (if in doubt about the issue being a bug at all, 
etc.), or do you prefer if I ask here in the forums first? (it 
may be helpful for those lurking, but which don't read the bug 
reports?)
Oct 08 2013
parent =?UTF-8?B?Ikx1w61z?= Marques" <luis luismarques.eu> writes:
On Tuesday, 8 October 2013 at 18:10:12 UTC, Luís Marques wrote:
 I just wanted to clarify which. I can open a bug report after 
 clarifying.

 In the future, should I just file bug reports and ask any 
 questions there (if in doubt about the issue being a bug at 
 all, etc.), or do you prefer if I ask here in the forums first? 
 (it may be helpful for those lurking, but which don't read the 
 bug reports?)

http://d.puremagic.com/issues/show_bug.cgi?id=11214
Oct 09 2013