Unittest hangs on completion

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 29 17:25:50 PST 2016


On 12/29/16 7:49 PM, David Zhang wrote:
> On Friday, 30 December 2016 at 00:44:50 UTC, Steven Schveighoffer wrote:
>>
>> Where does the "All unit tests have been completed successfully."
>> message come from? That's not standard D, which prints nothing.
>>
>
> I should have mentioned that I use dub then, shouldn't I? Anyway, this
> is what I get:
>
> C:\Users\David\Projects\weave>dub test
> Generating test runner configuration '__test__library__' for 'library'
> (library).
> Performing "unittest" build using dmd for x86.
> weave ~master: building configuration "__test__library__"...
> Linking...
> Running .\bin\__test__library__.exe
> All unit tests have been run successfully.

Looks like that comes from here:

https://github.com/dlang/dub/blob/master/source/dub/dub.d#L577

I have serious doubts that this is the correct way to run tests, as 
share ctors are supposed to have run BEFORE unit tests are allowed to. 
It's quite possible (and likely) that unit tests are running before 
critical other shared ctors have completed, which is why something isn't 
working.

In any case, it looks like the unit tests have run, and run 
successfully, and then main has run, and then it's the teardown of the 
runtime that's hanging.

I'm not 100% certain, because I don't know exactly how this code comes 
into play -- it's a string in this file.

-Steve


More information about the Digitalmars-d-learn mailing list