Named unittests and __traits(getModules)
Andre Pany
andre at s-e-a-p.de
Thu May 23 20:42:29 UTC 2019
On Thursday, 23 May 2019 at 18:01:32 UTC, Jacob Carlborg wrote:
> On 2019-05-21 11:43, Atila Neves wrote:
>
>> How would this work with separate compilation?
>
> I have given this some more thought. For my idea to work,
> regardless of separate compilation, I think the compiler needs
> to invoke a template that uses `__traits(getRootModules)` which
> collects all tests. If it's not a template I'm guessing this
> would contain the files passed to the compiler when druntime
> was built and not when the user application is built.
>
> Then it would collect the unit tests to a global variable, that
> should work with separate compilation as well, I think.
One thing I do not understand. Once module A, which contains the
new traits, is compiled using separate compilation, the list of
found modules is fixed. If now new module B is added, nothing
will cause a rebuild of A and therefore the list of found modules
is incomplete.
This can of course be solved by telling the user to not use
separate compilation, which might be a fair tradeoff, I am not
sure.
Kind regards
Andre
More information about the Digitalmars-d
mailing list