[phobos] Silent failure of std.container unittests

Walter Bright walter at digitalmars.com
Thu Jul 15 15:00:36 PDT 2010



Andrei Alexandrescu wrote:
> On 07/14/2010 08:58 PM, Walter Bright wrote:
>>
>>
>>
>> Frankly, I don't think a configurable option is a good idea. Druntime
>> has a lot of user configurability, and as far as I can tell, absolutely
>> none of it has ever been used. It just adds complexity, both to the code
>> and the documentation.
>
> I agree. But also simple does not mean crappy. I think there's too 
> much talk around a simple matter:
>
> ======
> Assertion failure should abort the current unittest block.
> ======
>
> Do we all agree about the above?

Not me.

> We keep on discussing how the usefulness and informativeness of 
> assertion failures falls off a cliff after the first failure, and I 
> can't seem to hear loud and clear that we all want this same thing.
>
> So we've been through these steps:
>
> 1. Crappy: failure to assert causes the program to abort.

Agreed.

>
> 2. Awful: assert is hacked inside unittests to essentially be writeln, 
> all unittests run regardless. Programs claims success upon exit.

This was a bug, nobody intended this behavior.

>
> 3. Mediocre: assert continues to be hacked inside unittests to 
> essentially be writeln + set a flag. Programs exit with errors if the 
> flag was set.

Yes, I think this is the correct behavior.

>
> NOT YET:
>
> 4. DESIRED: assert is NOT hacked, any failing assert ends the current 
> unittest, the failure message is printed, execution continues with the 
> next unittest, program ends with error code if at least one assert 
> failed, everybody's happy.
>

Everybody's happy except the guys like me who want to run all the unit 
tests in one go.


More information about the phobos mailing list