Parallel execution of unittests

Xavier Bigand via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 19:32:42 PDT 2014


Le 01/05/2014 03:54, Andrei Alexandrescu a écrit :
> 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
>
Then I am pretty much ok with the parallelization of all unittests.

It stay the question of name, I don't really know if it have to be in 
the language or in phobos like other tests features (test-logger, 
benchmark,...).


More information about the Digitalmars-d mailing list