Parallel execution of unittests

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


On Wed, 30 Apr 2014 15:33:17 -0700
"H. S. Teoh via Digitalmars-d" <digitalmars-d at puremagic.com> wrote:

> On Wed, Apr 30, 2014 at 02:48:38PM -0700, Jonathan M Davis via
> Digitalmars-d wrote:
> > On Wed, 30 Apr 2014 21:09:14 +0100
> > Russel Winder via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> [...]
> > > In which case D is wrong to allow them in the unittest blocks and
> > > should introduce a new way of handling these tests. And even then
> > > all tests can and should be parallelized. If they cannot be then
> > > there is an inappropriate dependency.
> > 
> > Why? Because Andrei suddenly proposed that we parallelize unittest
> > blocks? If I want to test a function, I'm going to put a unittest
> > block after it to test it. If that means accessing I/O, then it
> > means accessing I/O. If that means messing with mutable, global
> > variables, then that means messing with mutable, global variables.
> > Why should I have to put the tests elsewhere or make is that they
> > don't run whenthe -unttest flag is used just because they don't
> > fall under your definition of "unit" test?
> [...]
> 
> What about allowing pure marking on unittests, and those unittests
> that are marked pure will be parallelized, and those that aren't
> marked will be run serially?

I think that that would work, and if we added purity inferrence to
unittest blocks as Nordlow suggests, then you wouldn't even have to
mark them as pure unless you wanted to enforce that it be runnable in
parallel.

- Jonathan M Davis


More information about the Digitalmars-d mailing list