Get UDA of unit tests during Runtime.moduleUnitTester

Matthew Remmel via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 26 06:37:12 PDT 2017


On Wednesday, 26 July 2017 at 06:47:20 UTC, Jacob Carlborg wrote:
> On 2017-07-26 05:27, Matthew Remmel wrote:
>
>> [...]
>
> Unless you want to go with the approach Seb suggested, using 
> unit-threaded, you need to recursively iterate the module to 
> get all aggregates using __traits(allMembers) then use 
> __traits(getUnitTests) for each aggregate to get all unit tests.
>
>> [...]
>
> That's not possible, the UDAs are lost after compile time. 
> Also, all the unit tests block are combined into one function 
> per module, which is what Runtime.moduleUnitTester is running. 
> The separate unit test blocks are gone at runtime so there's 
> nothing to connect the UDAs to.

Thanks for the info, I'll look into the threaded unit test 
library and see what they are doing, and how.

-Matt


More information about the Digitalmars-d-learn mailing list