[Issue 5091] main runs after unittests

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 21 01:08:00 PDT 2010


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


Peter Alexander <peter.alexander.au at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter.alexander.au at gmail.co
                   |                            |m


--- Comment #1 from Peter Alexander <peter.alexander.au at gmail.com> 2010-10-21 01:07:14 PDT ---
(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?

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.

The whole point of unit tests is that they are run regularly, preferably after
ever change. If you only run them after lots of changes then it makes it much
more difficult to find out what broke the build.

If you have a lot of time-consuming unit tests in your code then these should
be put inside a slowtest version block so that you can leave those for your
nightly testing (or whatever you want to do). In general however, unittest
should always be on.

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