[phobos] Unittest errors on windows with latest phobos sources
Sean Kelly
sean at invisibleduck.org
Mon Jul 5 22:07:08 PDT 2010
On Jul 5, 2010, at 9:13 PM, Andrei Alexandrescu wrote:
> On 07/05/2010 02:44 PM, Walter Bright wrote:
>> The failing unittests still exit with an errorlevel. The change was to
>> not exit immediately on the assert error, but to remember that it
>> failed, run all the unittests, then exit with errorlevel set to 1 if any
>> of them had failed.
>
> I'm glad we see eye to eye on that! In fact there is a bug in your implementation of Linux - it doesn't do as you mention above. Look at this:
>
> $ generated/posix/debug/unittest/std/xml
> std.xml(379): unittest failure
> $ echo $?
> 0
> $ _
>
> So something somewhere makes the program return success even though it fails.
That's probably my fault. The unittest handler returns a boolean to indicate whether the app should run when tests complete. I believe Walter repurposed it to have the unittest handler indicate success/failure and I changed it back. We really need to be able to do both--set a result and allow only tests to be run. It may be worth adding a Runtime.result property that the app returns on exit, but it could be weird dealing with both this and the result from Dmain if they conflict. The easiest alternative would be to either change the calling convention for the unittest handler, or add some kind of global flag to indicate whether Dmain should be run.
More information about the phobos
mailing list