Should unittests run as logical part of compilation?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jan 27 07:59:41 PST 2014


On 1/26/14 10:08 PM, H. S. Teoh wrote:
> On Sun, Jan 26, 2014 at 08:15:23PM -0800, Andrei Alexandrescu wrote:
>> On 1/26/14 8:08 PM, Jesse Phillips wrote:
>>> On Monday, 27 January 2014 at 03:58:54 UTC, Andrei Alexandrescu wrote:
>>>> Yeppers. One other thought I had was to define a special flag e.g.
>>>> --4c5ad7908c2aa1b3de32ea25968cdf49 that says "just run unittests".
>>>
>>> I really think it would be better to use
>>> --4c5ad7908c2aa1b3de42ea25968cdf49 instead, it just makes the intent
>>> clearer.
>>
>> I'm just saying it should not clash with any application argument.
> [...]
>
> That won't work if the application is a git client looking for an SHA
> hash argument...

Of course it works unless there's a clash with this particular SHA.

> Let's not add arbitrary things like this to D programs, it doesn't
> address the issue and only introduces needless special cases.

I don't see that a special case. The only idea here is to produce one 
single debug executable containing unittests and running them on demand 
(e.g. by the build system).



Andrei



More information about the Digitalmars-d mailing list