How can one reliably run unittests

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Sep 5 15:04:58 UTC 2021


On Fri, Sep 03, 2021 at 08:39:35AM +0000, deadalnix via Digitalmars-d wrote:
[...]
> > > 3/ it still isn't possible to run the unit tests of several
> > > modules in one go by passing a list of modules to the compiler (in
> > > the same way you can compile several modules in one go and
> > > generate an object file for all of them at once).
> > 
> > Of course you can.  Under my proposal:
> > 
> > 	dmd -unittest=module -i -run mod1.d mod2.d mod3.d main.d
> > 
> 
> No, this will run the code in mod1.d , passing ["mod2.d" "mod3.d"
> "main.d"] as command line arguments.

Oh right, this is the other bogonity of -run: it expects the following
argument to be the module that gets run.  I really don't understand the
logic of this: surely the compiler ought to be able to know which module
main() is declared in, so why does it need the user to select one
specific module to be run?  This should be automated within the compiler
itself.


T

-- 
Never criticize a man until you've walked a mile in his shoes. Then when you do criticize him, you'll be a mile away and he won't have his shoes.


More information about the Digitalmars-d mailing list