Re: Problem with code coverage. No .lst files?

2014-04-26 Thread Jeremy DeHaan via Digitalmars-d-learn

On Friday, 25 April 2014 at 08:20:37 UTC, Jeremy DeHaan wrote:

On Friday, 25 April 2014 at 04:23:45 UTC, Ali Çehreli wrote:

On 04/24/2014 08:32 PM, Jeremy DeHaan wrote:

 added the -cov switch to my unit test build

Then you must execute the program. :)

Ali


I did, but still nothing. I even tried using the switch in a 
debug build and the same thing happened(or didn't happen I 
guess). I'm using Mono-D to build if that makes any difference, 
and I've tried running it both through Mono-D and via the 
application itself. I'm not sure what to do. :(


Well, I think I found out what was happening. If you compile with 
-cov AND use -of where the output file is in a different 
directory than where the build is taking place(eg, buld happens 
in C:/DProject/, and the command line has 
-ofC:/DProject/Unittest/Unittest.exe), no .lst files are 
produced. I guess the compiler isn't sure where to put them? In 
any case, I removed the -of switch and when I ran that 
application .lst files were now created in the same directory as 
the application. Is this a bug that needs to be reported?


Here's a simple test that reproduces the issues.

test.d
===
module test;

class Test
{
int thing;
this(int newThing)
{
thing = newThing;
}

void showThing()
{
import std.stdio;
writeln(thing);
}
}

unittest
{
auto tester = new Test(100);
tester.showThing();
}


command line that will produce .lst file: dmd test.d -cov 
-unittest -main -ofWill.exe


command line that won't produce .lst file: dmd test.d -cov 
-unittest -main -oftest\Wont.exe


Re: Problem with code coverage. No .lst files?

2014-04-26 Thread Ali Çehreli via Digitalmars-d-learn

On 04/26/2014 01:11 PM, Jeremy DeHaan wrote:

 If you compile with -cov
 AND use -of where the output file is in a different directory than where
 the build is taking place(eg, buld happens in C:/DProject/, and the
 command line has -ofC:/DProject/Unittest/Unittest.exe), no .lst files
 are produced.

I can reproduce it under Linux if I change to the program directory and 
run the program in there. However, if I run the program with its full 
path when I am inside the original directory where I built the program 
from, then the .lst file gets generated.


 Is this a bug that needs to be reported?

Yes.

 command line that will produce .lst file: dmd test.d -cov -unittest
 -main -ofWill.exe

 command line that won't produce .lst file: dmd test.d -cov -unittest
 -main -oftest\Wont.exe

So, under Linux, if I start the program as test/wont then the .lst gets 
generated in the current directory.


Ali



Re: Problem with code coverage. No .lst files?

2014-04-26 Thread Jeremy DeHaan via Digitalmars-d-learn

On Sunday, 27 April 2014 at 00:37:39 UTC, Ali Çehreli wrote:
So, under Linux, if I start the program as test/wont then the 
.lst gets generated in the current directory.


Ali


Just tried that in Windows, and the same thing happened. Weird!

I'll be sure to file a bug report. Thanks for the confirmation, 
Ali!




Re: Problem with code coverage. No .lst files?

2014-04-25 Thread Jeremy DeHaan via Digitalmars-d-learn

On Friday, 25 April 2014 at 04:23:45 UTC, Ali Çehreli wrote:

On 04/24/2014 08:32 PM, Jeremy DeHaan wrote:

 added the -cov switch to my unit test build

Then you must execute the program. :)

Ali


I did, but still nothing. I even tried using the switch in a 
debug build and the same thing happened(or didn't happen I 
guess). I'm using Mono-D to build if that makes any difference, 
and I've tried running it both through Mono-D and via the 
application itself. I'm not sure what to do. :(


Re: Problem with code coverage. No .lst files?

2014-04-24 Thread Ali Çehreli via Digitalmars-d-learn

On 04/24/2014 08:32 PM, Jeremy DeHaan wrote:

 added the -cov switch to my unit test build

Then you must execute the program. :)

Ali