digitalmars.D.learn - Problem with code coverage. No .lst files?
- Jeremy DeHaan (8/8) Apr 24 2014 Hey all,
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (3/4) Apr 24 2014 Then you must execute the program. :)
- Jeremy DeHaan (6/10) Apr 25 2014 I did, but still nothing. I even tried using the switch in a
- Jeremy DeHaan (36/49) Apr 26 2014 Well, I think I found out what was happening. If you compile with
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (9/19) Apr 26 2014 I can reproduce it under Linux if I change to the program directory and
- Jeremy DeHaan (4/7) Apr 26 2014 Just tried that in Windows, and the same thing happened. Weird!
Hey all, I tried to use code coverage analysis for the first time tonight. I added the -cov switch to my unit test build, but no matter what I do, I can't seem to locate the produced .lst files. Is there something I should know that isn't in the docs that I might be doing wrong? I'm not sure what's going on here. Thanks, Jeremy
Apr 24 2014
On 04/24/2014 08:32 PM, Jeremy DeHaan wrote:added the -cov switch to my unit test buildThen you must execute the program. :) Ali
Apr 24 2014
On Friday, 25 April 2014 at 04:23:45 UTC, Ali Çehreli wrote:On 04/24/2014 08:32 PM, Jeremy DeHaan wrote: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. :(added the -cov switch to my unit test buildThen you must execute the program. :) Ali
Apr 25 2014
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: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.exeOn 04/24/2014 08:32 PM, Jeremy DeHaan wrote: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. :(added the -cov switch to my unit test buildThen you must execute the program. :) Ali
Apr 26 2014
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.exeSo, under Linux, if I start the program as test/wont then the .lst gets generated in the current directory. Ali
Apr 26 2014
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. AliJust tried that in Windows, and the same thing happened. Weird! I'll be sure to file a bug report. Thanks for the confirmation, Ali!
Apr 26 2014