dunit 0.7.0 released
Jonathan M Davis
jmdavisProg at gmx.com
Mon Oct 21 05:24:06 PDT 2013
On Monday, October 21, 2013 14:10:13 Dicebot wrote:
> On Monday, 21 October 2013 at 11:58:14 UTC, Jonathan M Davis
>
> wrote:
> > I confess that I don't understand why anyone is creating any
> > unit test
> > projects for D, and I'd likely vote against any attempt to add
> > such a thing to
> > Phobos. D has built in unit testing functionality, and it works
> > great. Maybe
> > some additional assert-like functions could be useful (similar
> > to assertThrown
> > or assertNotThrown), but we really don't need much beyond what
> > the language
> > provides.
>
> Sorry but it feels like you didn't really investigate the topic.
> D built-in unit-test facilities are a basic and extendable
> framework. Many notable unittest libraries work on top of it
> (using custom assert helpers and/or __traits(getUnittests)) being
> at the same time perfectly compatible with raw `dmd -unittest
> -main -run file.d`.
>
> At the very same time built-in reporting facilities are very
> limited and almost any bigger project will want some extension.
> Assuming full compatibility with built-in ones and zero external
> dependencies I don't see why this can't go to Phobos.
I know that you can extend the built-in facilities by overriding how assert
works and the like. I also see no reason to do so. IIRC, such facilities were
even removed at one point, because no one was using them. They were readded
after someone complained about wanting them, but every time I see anyone
talking about doing anything with those, it seems like overkill to me. And
since it's frequently for nonsense like making it so that the tests continue
after an assertion fails (which is outright bad practice IMHO), I have a very
low opinion of attempts to override the built-in assert for unit tests.
If someone wants to present something to the review queue that's related to
unit tests, that's fine. But I really don't see any problem with the built-in
unit tests facilities and would expect to be against any such submission,
particularly since every time I've delved into any discussions on them, what
folks are doing with them has seemed like a really bad idea to me. But I guess
that we'll just have to wait and see what gets submitted for review, if
anything.
- Jonathan M Davis
More information about the Digitalmars-d-announce
mailing list