DMD: how to restore old unittest+main

Jonathan daemon512 at gmail.com
Thu Aug 13 08:30:44 UTC 2020


On Thursday, 13 August 2020 at 07:52:07 UTC, novice3 wrote:
> Hello.
>
> I don't use dub.
> I use Windows and *.d file association to compile small apps by 
> dmd with "-i -unittest -g" switches.
> Now i update dmd, and found, that apps compiled with 
> "-unittest" not runs main().
>
> How i can restore old behaviour (run all unittests then main())
> *without use "--DRT-testmode=run-main" switch every time then i 
> start compiled app.exe*?
> I want just press Enter on app.d file, then press Enter on 
> app.exe.
> Any advises?
>
> Thanks.

Is there a reason you need to run all unittests every time you 
want to run the program?

I personally compile with -unittest to make sure all my unittests 
pass, then recompile without the -unittest flag if I actually 
want to run the program.  This way, time isn't wasted running 
unittests every time the program is run.


More information about the Digitalmars-d-learn mailing list