ModuleInfo, factories, and unittesting

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 20 00:01:25 PST 2016


On 12/18/2016 06:53 PM, Andrei Alexandrescu wrote:
> Compulsive ModuleInfo generation seems to be a drag. I'm not very
> familiar with the particulars but my understanding is ModuleInfo is
> needed for (a) Object.factory and (b) finding and running unittests.
> 
> Walter and I think Object.factory was a mistake and we'd like to make it
> opt-in long term (either by means of a build flag or a class attribute).
> 
> Until then, a very nice step forward is to NOT generate ModuleInfo if a
> module introduces no class.
> 
> For unittests, I figure things like static introspection should make it
> easier to enumerate and run unittests without a need for ModuleInfo.
> 
> What other issues/opportunities do you see related to ModuleInfo?
> 
> 
> Thanks,
> 
> Andrei

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).



-------------- 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/39ca2c78/attachment.sig>


More information about the Digitalmars-d mailing list