[phobos] Silent failure of std.container unittests

Jonathan M Davis jmdavisprog at gmail.com
Thu Jul 15 08:20:18 PDT 2010


On Thursday 15 July 2010 06:57:47 Steve Schveighoffer wrote:
> 
> Here is one option that I haven't seen yet -- the compiler inserts around
> all unit test blocks the following framework:
> 
> try
> {
>    // run individual unit test block
> }
> catch(AssertionError ae)
> {
>    __onAssert(ae);
> }
> 
> And then we can control exactly what happens on assert.  Someone may create
> some sort of graphical thing, or it could be plugged into an IDE.

That sounds like a good idea. Certainly, I've worked in places where we had the 
IDE set up to not only run unit tests but indicated which failed and which 
succeeded, and dealing with all that from the IDE was quite nice. Having built 
in unit tests in D is great, but thus far it's led to a fairly simplistic 
implementation in terms of what you can do with it. Something which allowed 3rd 
party tools to plug in to it or which could later be reasonably extended to do 
so would be good. It does seem to me that #4 could be reasonably extended to 
this later if it weren't implemented like this now.

- Jonathan M Davis


More information about the phobos mailing list