Named unittests

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat May 18 14:56:16 UTC 2019


On 5/18/19 2:20 PM, Adam D. Ruppe wrote:
> On Saturday, 18 May 2019 at 05:49:00 UTC, H. S. Teoh wrote:
>> Dmd already has -run, so it's not too much of a stretch to change the 
>> behaviour of -unittest into the equivalent of today's:
>>
>>     dmd -unittest -run blah.d
> 
> Actually, right after I went to bed, I realized the solution to 
> everyone's problem.
> 
> We all want `-unittest=package,list` to control which tests are run.

Doesn't that seem a bit much? It seems to me you either want to run 
unittests or not, why run just a few? Going with the typechecking 
metaphor - do we want to check some modules but not others?

If including/excluding certain unittests is needed e.g. for time 
reasons, "version" seems the right tool for the job. Or compiling some 
modules with -unittest and others without. But that should be the 
special case, not something supported at the command line level.

> That doesn't exist yet which means it is our opportunity to change other 
> things along with the new syntax.
> 
> dmd -unittest # existing behavior, no changes
> dmd -unittest=package,list # implies -run, -main when needed, triggers 
> new druntime behavior

Neither seems to help the simple case, which is "compile, link, and run 
all unittests without running main". I'm afraid this is heading toward a 
gallop of overengineering.


More information about the Digitalmars-d mailing list