Named unittests

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 31 06:28:52 PDT 2015


On 3/31/15 9:05 AM, w0rp wrote:
> On Tuesday, 31 March 2015 at 12:33:31 UTC, Steven Schveighoffer wrote:
>> On 3/30/15 5:58 PM, Dicebot wrote:
>>> I'd prefer putting alternative test runner into Phobos instead which
>>> will support `@name("Something") unittest { }`
>>
>> Yes, this is one of the benefits I touted 2 years ago when I asked for
>> module RTInfo -- we can use this information in the runtime to
>> instrument how we run unit tests.
>>
>> We still don't have module RTInfo.
>>
>> And yes, then it can be a library solution. unittests are a language
>> feature, but only in how they are compiled and linked. The runtime is
>> fully responsible for how they are run. All we need is a way to tell
>> the compiler how to describe them to the runtime.
>
> ModuleInfo does actually exist, but it's not documented. I'm not sure if
> it's usable for this purpose though. Maybe?

No, I mean this: https://github.com/D-Programming-Language/dmd/pull/2271

Essentially, you have user-defined generation of runtime info stored 
inside the ModuleInfo. When this is working, we can do whatever we want 
for unit tests via attributes.

-Steve


More information about the Digitalmars-d mailing list