Parallel execution of unittests

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 14:30:07 PDT 2014


On Wed, 30 Apr 2014 18:53:22 +0000
monarch_dodra via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> On Wednesday, 30 April 2014 at 15:54:42 UTC, bearophile wrote:
> >> We've resisted named unittests but I think there's enough
> >> evidence to make the change.
> >
> > Yes, the optional name for unittests is an improvement:
> >
> > unittest {}
> > unittest foo {}
> >
> > I am very glad your coworker find such usability problems :-)
> 
> If we do "name" the unittests, then can we name them with 
> strings? No need to polute namespace with ugly symbols. Also:
> 
> //----
> unittest "Sort: Non-Lvalue RA range" { ... }
> //----
> vs
> //----
> unittest SortNonLvalueRARange { ... }
> //----

It would be simple enough to avoid polluting the namespace. IIRC, right
now, the unittest blocks get named after the line number that they're
on. All we'd have to do is change it so that their name included the
name given by the programmer rather than being the name given by the
programmer. e.g.

unittest(testFoo)
{
}

results in a function called something like unittest_testFoo.

- Jonathan M Davis


More information about the Digitalmars-d mailing list