Is it normal that unittests of phobos are executed with my project build?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 16 07:29:09 PDT 2014


On Sat, 14 Jun 2014 10:32:04 -0400, Xavier Bigand  
<flamaros.xavier at gmail.com> wrote:

> I get a failure on a test in format.d when I build my own project with  
> unittest. I though importing phobos header would not regenerate their  
> unittest modules.
>
> Any idea of what can cause this issue? I already have reinstalled dmd  
> with visualD completely.

Templates are not compiled fully until you use them.

If a unit test is inside a template, and that template wasn't instantiated  
inside phobos itself (likely for formatting), it will be instantiated,  
unit test and all, inside your code that used it.

This is a big limitation on the unit test system. There is no way to say  
what unit tests to enable, and what to disable. It's just all or nothing.

-Steve


More information about the Digitalmars-d-learn mailing list