ModuleInfo, factories, and unittesting

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 20 11:05:49 PST 2016


On 12/20/2016 08:33 PM, Walter Bright wrote:
> On 12/20/2016 12:01 AM, Dicebot wrote:
>> We rely on ModuleInfo for custom test runner in ocean
>> (https://github.com/sociomantic-tsunami/ocean/blob/v2.x.x/src/ocean/core/UnitTestRunner.d).
>>
>> Static introspection can't provide same functionality in general case
>> (even if all bugs will be fixed) because it requires either maintaining
>> list of all modules or ensuring everything is imported from some root
>> module. Former is inconvenience, latter is simply not true for libraries
>> (though can be worked around by build system).
> 
> Does that simply need to find all the unit tests? (There are ways to do
> that without ModuleInfo, it's just that it's convenient and portable
> with ModuleInfo.)

Yes, pretty much. What ways do you have in mind? I am only aware of two:

1) ModuleInfo
2) https://dlang.org/spec/traits.html#getUnitTests

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20161220/45c2b741/attachment.sig>


More information about the Digitalmars-d mailing list