ModuleInfo, factories, and unittesting

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 22 01:10:53 PST 2016


On 12/21/2016 11:24 PM, Walter Bright wrote:
> On 12/21/2016 9:43 AM, Johannes Pfau wrote:
>> You need some kind of linker support to do this to provide the
>> start/end symbols.
>
> That's partially correct. I've done this for decades by having the compiler
> itself emit those symbols.
>
> There are other tricks one can do, such as putting the pointers into the
> exception handler tables sections.
>

Or have the compiler call a "registerUnittest()" function with a parameter 
that's the pointer to the unittest info. Of course, that would require that a 
registerUnittest function exists somewhere.


More information about the Digitalmars-d mailing list