How can one reliably run unittests

Mathias LANG geod24 at gmail.com
Wed Aug 25 07:50:50 UTC 2021


On Tuesday, 24 August 2021 at 17:45:20 UTC, deadalnix wrote:
>
> The compiler KNOWS if there is a main or not. The compiler 
> KNOWS if I want unittests or not. Yet it's going to do retarded 
> stuff unless one uses a bunch of workarounds.

This. I think the original implementers had a different idea of 
how things would be used. For a long time, unittests would run 
first, then the main would be called. We all know how annoying 
that was, (most) people do not want this, they wanted two 
different modes, clearly separated. I say most, because there are 
still a few hold out I think.

Personally, I'd like my unittest binary to generate something 
that has a much better UX than what's currently in druntime. You 
know, timing statistics, colors, ability to run a single test, 
the whole thing.

I'm aware that there are frameworks out there, but it needs to be 
built-in.


More information about the Digitalmars-d mailing list