Re: Cumulative code coverage?

2018-03-22 Thread H. S. Teoh via Digitalmars-d
On Thu, Mar 22, 2018 at 06:31:21AM +, Petar via Digitalmars-d wrote:
> On Wednesday, 21 March 2018 at 19:44:19 UTC, H. S. Teoh wrote:
> > On Wed, Mar 21, 2018 at 12:35:08PM -0700, H. S. Teoh via Digitalmars-d
> > wrote: [...]
> > > Cool, passing --DRT-covopt="merge:1" did the trick.
> > [...]
> > 
> > Speaking of which, are the --DRT-* options documented anywhere?? I
> > don't even know where to begin to look, besides in the druntime code
> > itself.
[...]
> I think you're looking for: "Controlling the Coverage Analyser" under
> https://dlang.org/articles/code_coverage.html.

Ah, thanks!  That's exactly what I was looking for.

Still, it would be nice to have a list of all --DRT-* options (not
necessarily related to coverage) somewhere, just for reference.


T

-- 
If you want to solve a problem, you need to address its root cause, not just 
its symptoms. Otherwise it's like treating cancer with Tylenol...


Re: Cumulative code coverage?

2018-03-22 Thread Petar via Digitalmars-d

On Wednesday, 21 March 2018 at 19:44:19 UTC, H. S. Teoh wrote:
On Wed, Mar 21, 2018 at 12:35:08PM -0700, H. S. Teoh via 
Digitalmars-d wrote: [...]

Cool, passing --DRT-covopt="merge:1" did the trick.

[...]

Speaking of which, are the --DRT-* options documented 
anywhere?? I don't even know where to begin to look, besides in 
the druntime code itself.



T


I think you're looking for: "Controlling the Coverage Analyser" 
under https://dlang.org/articles/code_coverage.html.


Re: Cumulative code coverage?

2018-03-21 Thread H. S. Teoh via Digitalmars-d
On Wed, Mar 21, 2018 at 12:35:08PM -0700, H. S. Teoh via Digitalmars-d wrote:
[...]
> Cool, passing --DRT-covopt="merge:1" did the trick.
[...]

Speaking of which, are the --DRT-* options documented anywhere?? I
don't even know where to begin to look, besides in the druntime code
itself.


T

-- 
Unix was not designed to stop people from doing stupid things, because that 
would also stop them from doing clever things. -- Doug Gwyn


Re: Cumulative code coverage?

2018-03-21 Thread H. S. Teoh via Digitalmars-d
On Wed, Mar 21, 2018 at 05:34:58PM +, Seb via Digitalmars-d wrote:
> On Wednesday, 21 March 2018 at 16:39:48 UTC, H. S. Teoh wrote:
> > Is it possible to get cumulative code coverage using dmd? I.e.,
> > accumulate code coverage stats over a series of runs from an
> > external test suite.
[...]
> Yes, either set dmd_coverSetMerge(true) or pass --DRT-covopt "merge:1"
> to your program.
[...]

Cool, passing --DRT-covopt="merge:1" did the trick.

Thanks!


T

-- 
Bare foot: (n.) A device for locating thumb tacks on the floor.


Re: Cumulative code coverage?

2018-03-21 Thread Seb via Digitalmars-d

On Wednesday, 21 March 2018 at 16:39:48 UTC, H. S. Teoh wrote:
Is it possible to get cumulative code coverage using dmd? I.e., 
accumulate code coverage stats over a series of runs from an 
external test suite.  Currently, it seems that compiling with 
-cov will just overwrite the *.lst files from previous runs.  
Do I have to merge the .lst files externally?


I'm currently writing an external test suite for one of my 
projects, and obviously, each individual test isn't going to 
cover the entire code. So the idea is to write a series of 
tests that cumulatively test all code paths.



T


Yes, either set dmd_coverSetMerge(true) or pass --DRT-covopt 
"merge:1" to your program.
You can also set the environment variable DRT_COVOPT, but I think 
you need to enable this by setting rt_envvars_enabled to true 
before.


https://dlang.org/phobos/core_runtime.html#.dmd_coverSetMerge
https://dlang.org/changelog/2.078.0.html#covopts


Cumulative code coverage?

2018-03-21 Thread H. S. Teoh via Digitalmars-d
Is it possible to get cumulative code coverage using dmd? I.e.,
accumulate code coverage stats over a series of runs from an external
test suite.  Currently, it seems that compiling with -cov will just
overwrite the *.lst files from previous runs.  Do I have to merge the
.lst files externally?

I'm currently writing an external test suite for one of my projects, and
obviously, each individual test isn't going to cover the entire code.
So the idea is to write a series of tests that cumulatively test all
code paths.


T

-- 
"Holy war is an oxymoron." -- Lazarus Long