[Issue 5091] main runs after unittests

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 21 10:33:19 PDT 2010


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



--- Comment #4 from Simen Kjaeraas <simen.kjaras at gmail.com> 2010-10-21 10:32:36 PDT ---
(In reply to comment #1)
> (In reply to comment #0)
> > When compiling a program with dmd -unittest, after the unittests are run,
> > main() is called. This is rarely wanted behavior, so should not be the default.
> 
> Why is this rarely wanted?

Because I never want my program to run after I run my unittests? If the
unittests pass, my program should be working, apart from things that are
impossible/hard to unittest.

> If your way was the default then your work flow would be:
> 
> - Make change
> - Run with unit test
> - Run without unit test
> - Make change
> - Run with unit test
> - Run without unit test
> - etc.

That's one possibility. When I program, I aim for such coverage with my
unittests that running the program to see if things work is not necessary.
Hence, a more likely scenario:

1 Make change
2 Run unittests (quick)
3 If unittests fail, goto 1
4 Run normally (slow)
5 Goto 1

I have not once wanted to run both the full application and the unittests at
the same time. when I want to run the unittests, running the application would
be a waste of time. When I want to run the program, I don't care about the
unittests.

-- 
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