[Issue 5091] main runs after unittests

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 13 16:27:39 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=5091



--- Comment #9 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-13 16:27:36 PDT ---
(In reply to comment #7)
> It's a little hacky though, because returning false is interpreted as failed
> tests.

Perhaps we could change ModuleUnitTester to return an int instead of a bool.
Then 0 would mean tests failed, 1 would mean continue execution to main, and a
new return (say 2) would mean don't execute main().

runModuleUnitTests would also have to return this status code, and then in
dmain2.d we'd change:

if (runModuleUnitTests())

to:

if (runModuleUnitTests() == 1)

Of course it might be best to use an enumeration for this:

TestStatus
{
    Fail, Ok, SkipMain
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list