Parallel execution of unittests

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Thu May 1 04:31:53 PDT 2014


Am Thu, 01 May 2014 09:38:51 +0000
schrieb "Dicebot" <public at dicebot.lv>:

> On Thursday, 1 May 2014 at 08:51:47 UTC, Johannes Pfau wrote:
> 
> You only need to make sure all modules are transitively imported
> from initial one. Everything else can be done via recursive
> reflection with __traits(allMembers), module constructors are not
> needed either.
> 
> One can also generate special test entry module that imports all
> project modules using build system help.

Is there some boost licensed reflection code somewhere which shows how
to do recursive reflection correctly? I know the basic idea but stuff
like dealing with protection of members would take some time to
figure that out.

Maybe someone familiar with the details could sketch up a quick
std.test proof-of-concept which parses the following (with all
necessary protection checks + detecting unittest blocks in
classes/structs):
-----------
unittest
{
    
}

@_unittest void namedTest()
{
    
}
----------

@Andrei do you think having to explicitly import modules to be tested
is an issue? Apart from this limitation such an approach sounds great
to me. There are quite some possibilities how user frameworks could
extend std.test so it sounds like an interesting idea. (And
std.benchmark could work in the same way)


More information about the Digitalmars-d mailing list