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