[phobos] Silent failure of std.container unittests

Walter Bright walter at digitalmars.com
Tue Jul 13 12:11:38 PDT 2010


The changes I made to unittest worked when released in 2.044. They were 
subsequently rewritten and broken so that unittests never failed. I 
reverted the changes back to the 2.044 version. The current behavior is 
as in 2.044, where failing asserts inside a unittest block set a global 
flag, and then when all unittests are complete, if the global flag is 
set, the program exits with an error status.

Andrei Alexandrescu wrote:
> There are other problems with the current approach, which make it a 
> net pessimization:
>
> 1. assert() has different semantics at top level (straight inside the 
> unittest) vs. everywhere else (e.g. in functions called by the 
> unittest). That sucks.
>
> 2. assert() does not abort the current unittest. It continues 
> soldering on, even though code insite a given unittest commonly 
> assumes that continued execution implies success of the previous asserts.
>
> I protested when Walter introduced this disastrous semantics. He said, 
> "let's let it be for a while and see how it fares." Now "a while" has 
> passed. The feature fared badly. It is worse than before.
>
> By this I kindly ask that either things are improved by fixing both 1 
> and 2 above, or the old semantics are enacted.
>
> Walter, I understand you don't routinely test Phobos. Please also 
> understand that I test Phobos all the time. You are making my and 
> others' life difficult for no good reason.
>
>
> Andrei
>
> On 07/13/2010 10:13 AM, Steve Schveighoffer wrote:
>> isn't this just a bug?  I don't think the original unit test mode 
>> (where any
>> assert ends the whole program, with no stack trace) is a step forward.
>>
>> Can't we just fix the bugs?
>>
>> -Steve
>>
>>
>>
>>
>> ----- Original Message ----
>>> From: Andrei Alexandrescu<andrei at erdani.com>
>>> To: Discuss the phobos library for D<phobos at puremagic.com>
>>> Sent: Tue, July 13, 2010 10:57:24 AM
>>> Subject: Re: [phobos] Silent failure of std.container unittests
>>>
>>> Walter, Sean - I'm asking again, please bring unittests back where they
>>> were. The recent change to assert() semantics has cause a net
>>> pessimization of everyone's  efficiency.
>>>
>>> Thanks,
>>>
>>> Andrei
>>>
>>> On 07/13/2010 07:09 AM, Lars  Tandle Kyllingstad wrote:
>>>> I'm using Linux too, and DMD 2.047.  I've  investigated this some 
>>>> more.
>>>> Compilation of the std.container unittests  succeeds, but the 
>>>> executable
>>>>   generated/posix/debug/unittest/std/container terminates with exit 
>>>> status
>>>>   1.  Its main() function never runs.
>>>>
>>>>   -Lars
>>>>
>>>>
>>>> On Mon, 2010-07-12 at 09:18 -0500, Andrei  Alexandrescu wrote:
>>>>> Can't reproduce on  Linux.
>>>>>
>>>>> Andrei
>>>>>
>>>>> On 07/12/2010  08:55 AM, Lars Tandle Kyllingstad wrote:
>>>>>> When running 'make  unittest' on the latest revision of Phobos, 
>>>>>> it just
>>>>>> fails  on/after std.container, without any sensible error  message:
>>>>>>
>>>>>> Testing  generated/posix/debug/unittest/std/container
>>>>>> make[1]: ***  [generated/posix/debug/unittest/std/container] Error 1
>>>>>> make: ***  [unittest] Error 2
>>>>>>
>>>>>> Anyone else seeing  this?
>>>>>>
>>>>>> -Lars
>>>>>>
>>>>>>   _______________________________________________
>>>>>> phobos mailing  list
>>>>>> phobos at puremagic.com
>>>>>>   http://lists.puremagic.com/mailman/listinfo/phobos
>>>>
>>>>
>>>>   _______________________________________________
>>>> phobos mailing  list
>>>> phobos at puremagic.com
>>>> http://lists.puremagic.com/mailman/listinfo/phobos
>>> _______________________________________________
>>> phobos  mailing list
>>> phobos at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/phobos
>>>
>>
>>
>>
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>


More information about the phobos mailing list