[Issue 13454] Unit tests should be compiled in a module, where they are declared

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Apr 27 04:16:53 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=13454

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m

--- Comment #5 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
I would argue that it only makes sense to compile in unittest blocks or
version(unittest) code when directly compiling a module with -unittest and not
when importing it. Otherwise, you'll end up getting stuff like Phobos' unit
test code in your application when you compile it with -unittest, and the unit
test code in libraries like Phobos would then potentially affect your program,
causing fun problems like linker errors just because you imported a 3rd party
module inside of your own module that you're unit testing.

--


More information about the Digitalmars-d-bugs mailing list