Parallel execution of unittests

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 18:54:28 PDT 2014


On 4/30/14, 6:20 PM, Xavier Bigand wrote:
> Le 30/04/2014 17:59, Andrei Alexandrescu a écrit :
>> On 4/30/14, 8:54 AM, bearophile wrote:
>>> Andrei Alexandrescu:
>>>
>>>> A coworker mentioned the idea that unittests could be run in parallel
>>>
>>> In D we have strong purity to make more safe to run code in parallel:
>>>
>>> pure unittest {}
>>
>> This doesn't follow. All unittests should be executable concurrently. --
>> Andrei
>>
> But sometimes unittests have to use shared data that need to be
> initialized before them. File system operations are generally a critical
> point, if many unittest are based on same auto-generated file data it's
> a good idea to run this generation once before all tests (they
> eventually do a file copy that is fast with copy-on-write file system or
> those data can be used as read only by all tests).
> So for those kind of situation some functions have must be able to run
> before unittest, and I think that the case of static this() function of
> modules?

Yah version(unittest) static shared this() { ... } covers that. -- Andrei



More information about the Digitalmars-d mailing list