Named unittests

Petar Petar
Sun May 19 05:59:17 UTC 2019


On Saturday, 18 May 2019 at 17:52:40 UTC, Andrei Alexandrescu 
wrote:
> On 5/18/19 4:02 PM, Nicholas Wilson wrote:
>> On Saturday, 18 May 2019 at 14:56:16 UTC, Andrei Alexandrescu 
>> wrote:
>>> Doesn't that seem a bit much? It seems to me you either want 
>>> to run unittests or not, why run just a few? Going with the 
>>> typechecking metaphor - do we want to check some modules but 
>>> not others?
>> 
>> You almost always want to run _your_ tests not your 
>> dependencies tests, presumably they have already been tested 
>> and therefore do not need to be run.
>
> Wouldn't the dependencies be built separately (i.e. with a 
> different compiler invocation)?

If the dependencies are templated, like large portions of Phobos, 
then no, they and their unit tests will be compiled together with 
your code.

When you import a module, the compiler adds its unit tests to the 
list of all unit tests that need to be run. At the moment the 
compiler can't know if you're importing your own module (that you 
want to test) or a third-party one (that you don't care about its 
unit tests).


More information about the Digitalmars-d mailing list