Fix test coverage merging with the test_runner#1629
Conversation
|
Auto-merge toggled on |
Hmm the Makefile seems to do everything correctly: where |
|
Seems to happen because of the runForked in std.stdio, not sure how forking would disable the merge option. |
| version(D_Coverage) | ||
| { | ||
| import core.runtime : dmd_coverSetMerge; | ||
| dmd_coverSetMerge(true); |
There was a problem hiding this comment.
Well, this has always been wrong anyhow, b/c unittests are run from the runtime initialization before entering main.
That does make sense partially sense, because then the other processes are closed before the |
Ah of course, you set the merge flag after running the tests/forking. Well then this is the correct fix here. |
There is a weird case with
std.stdiowheredoTestis called 4x and for the first three times currently without the merge flag been set.This is a simple fix that just moves the setting of the merge flag in the static constructor, however if someone wants to look deeper into this, here's a strip down version of the
test_runner.For
std.jsonor any other module it will print as expectedwhere
mergeis an additional log output in the static deconstructor ofcover.dwhich just logs the currentmergeflag. Now withstd.stdiofor some reasondoTestis called 4xFor reference:
dlang/phobos#4719