Named unittests

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun May 19 18:37:55 UTC 2019


On 5/19/19 5:27 PM, Walter Bright wrote:
> On 5/18/2019 8:21 AM, H. S. Teoh wrote:
>> This should be pretty easy once we implement --DRT-run-unittests to only
>> run unittests and skip over main().
> 
> Actually, I'd just change the behavior so if any unittests are in the 
> executable, they are run and main() is not. main() is run only if there 
> are no unittests.

I'd find that confusing, and difficult to even describe. "-unittest does 
not run main if there are any unittests, but if there aren't, main will 
run". Randomly running main or not in a -unittest build seems just odd. 
A -unittest build with no unittests does nothing. Just like the plain 
English sentence says. KISS and all that. -unittest means build the unit 
test executable, period.

> In my experience, I've never wanted to run both in the same executable.

Let's do it!!!


More information about the Digitalmars-d mailing list