Parallel execution of unittests

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 08:54:52 PDT 2014


Am Wed, 30 Apr 2014 08:43:31 -0700
schrieb Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:

> However, this is too 
> coarse-grained - it would be great if each unittest could be pooled 
> across the thread pool. That's more difficult to implement.

I filed a pull request which allowed running unit tests individually
(and in different threads*) two years ago, but didn't pursue this
further:

https://github.com/D-Programming-Language/dmd/pull/1131
https://github.com/D-Programming-Language/druntime/pull/308

To summarize: It provides a function pointer for every  unit test to
druntime or user code. This is actually easy to do. Naming tests
requires changes in the parser, but I guess that shouldn't be difficult
either.


* Some time ago there was a discussion whether unit tests can rely on
  other tests being executed first / execution order. AFAIK some phobos
  tests require this. That of course won't work if you run the tests in
  different threads.


More information about the Digitalmars-d mailing list