External lib unittests: they're killin me!

Jens Mueller jens.k.mueller at gmx.de
Tue May 21 01:24:11 PDT 2013


Timothee Cour wrote:
> On Tue, May 21, 2013 at 12:35 AM, Jens Mueller <jens.k.mueller at gmx.de>wrote:
> 
> > Jacob Carlborg wrote:
> > > On 2013-05-21 03:52, Nick Sabalausky wrote:
> > > >Y'know what we need? This compiler flag:
> > > >
> > > >    -unittest=pagkage.name.*
> > >
> > > I wouldn't say no to that flag. Hmm, I'm wondering if it's possible
> > > to get the same functionality by implementing your own unit test
> > > runner.
> >
> > It is possible and we shouldn't push functionality into the compiler
> > when the issue is solvable in a library.
> > https://github.com/jkm/dtest (shameless plug) has the command line
> > switch --include to specify which modules should be tested.
> >
> > Jens
> >
> 
> That looks good, will try. However it doesn't address the issue of
> individual unittests (see 2nd post). Compiler support is needed for named
> unittests.

Johannes Pfau had a pull request for that very feature.
But I'd argue running separate unittests is the only feature that is
strictly needed from the compiler.
I mean to have named unittests you can use either UDAs

@name("myname")
unittest
{
}

or something like

unittest
{
    unittestName("myname");
}

Either way this is already doable in a good manner.
If there was a possibility to execute individual unittests it'll be
straightforward to add named unittests to dtest.
dmd developers are a scarce resource.

Jens


More information about the Digitalmars-d mailing list