Thread overview
Code-coverage
Dec 05, 2005
Sai
Dec 06, 2005
James Dunne
Dec 06, 2005
clayasaurus
Dec 06, 2005
clayasaurus
Dec 16, 2005
sai
Dec 16, 2005
Sean Kelly
December 05, 2005
My source files are spread in directories in java style. How can I do code coverage for all sources ?

with just -cov option, no .lst files are created.

Thanks in advance
Sai



December 06, 2005
Sai wrote:
> My source files are spread in directories in java style. How can I do code
> coverage for all sources ?
> 
> with just -cov option, no .lst files are created.
> 
> Thanks in advance
> Sai
> 
> 
> 

Hope you're not jumping the gun, but the .lst files are generated when the program is run.  I haven't tried a multi-directory style D app with -cov, but it works with a single-directory app.
December 06, 2005
Sai wrote:
> My source files are spread in directories in java style. How can I do code
> coverage for all sources ?
> 
> with just -cov option, no .lst files are created.
> 
> Thanks in advance
> Sai
> 
> 
> 

Yea, there should only be 1 .lst file created for your program. Compile your D program to an exe, then run 'dmd my.exe -cov'
December 06, 2005
clayasaurus wrote:
> Sai wrote:
> 
>> My source files are spread in directories in java style. How can I do code
>> coverage for all sources ?
>>
>> with just -cov option, no .lst files are created.
>>
>> Thanks in advance
>> Sai
>>
>>
>>
> 
> Yea, there should only be 1 .lst file created for your program. Compile your D program to an exe, then run 'dmd my.exe -cov'

Nevermind. My advice is to use build with the -cov option, then after you run your exe the .lst file should be created. Although in the bugs forum it looks like someone is having trouble with it.
December 16, 2005
Now I understand, why no .lst files were created for my program.

I was always exiting using std.c.stdlib.exit(0); which wasn't exiting cleanly. Today by mistake, due to an exception, when the program exited through return in "main", all .lst files were created !

Is there any clean way of exiting (or aborting) in D ?

Thanks in advance
Sai



In article <dn2dur$2bur$1@digitaldaemon.com>, Sai says...
>
>My source files are spread in directories in java style. How can I do code coverage for all sources ?
>
>with just -cov option, no .lst files are created.
>
>Thanks in advance
>Sai
>
>
>


December 16, 2005
sai wrote:
> Now I understand, why no .lst files were created for my program.
> 
> I was always exiting using std.c.stdlib.exit(0); which wasn't exiting cleanly. Today by mistake, due to an exception, when the program exited
> through return in "main", all .lst files were created !
> 
> Is there any clean way of exiting (or aborting) in D ? 

Nothing official, though you could try this:

throw new Exception("Terminate called.");



Sean