Named unittests
Johannes Pfau
nospam at example.com
Tue May 21 18:00:19 UTC 2019
Am Sun, 19 May 2019 09:13:21 -0400 schrieb Andrei Alexandrescu:
> On 5/19/19 10:25 AM, Johannes Pfau wrote:
>> Am Sat, 18 May 2019 13:55:39 -0400 schrieb Andrei Alexandrescu:
>>
>>
>>> Wait, if you build a program with -unittest will it run some/all of
>>> phobos' unittests? That would be indeed undesirable!
>>>
>>> I wonder how often people compile external libraries together with the
>>> application within the same command line.
>>
>> It runs some of the phobos unittests, those which are in templates
>> instantiated in user code:
>
> That is correct, and seems desirable. Instantiations of library
> templated types with user types should be tested during unittesting.
Most of the time that's true. However, this can get very annoying if the
phobos unit tests fail and you can't run your own tests as the runner
aborts after the first failed test. You also can't disable the phobos
test, as we don't have a way to disable tests.
So if you have a flaky phobos test (depends on network, datetime
(timezone files) or something similar) pulled into your application and
it fails, this might prevent you from testing application code. I think
this happened to me only once, but it was really, really annoying.
--
Johannes
More information about the Digitalmars-d
mailing list