Should unittests run as logical part of compilation?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jan 26 19:52:17 PST 2014


On 1/26/14 3:20 AM, anonymous wrote:
> On Sunday, 26 January 2014 at 05:17:15 UTC, H. S. Teoh wrote:
>> On Sun, Jan 26, 2014 at 04:29:10AM +0000, Rikki Cattermole wrote:
>>> Having the ability to run unittests at both compile time and runtime
>>> would be useful. Because what happens when you need to test e.g. an
>>> OS feature with it? Or have a dependency that simply cannot run at
>>> compile time?
>>>
>>> I'm all for being able to selectively run unittests and having the
>>> ability to have some run at compile time.
>>
>> +1. Some of my unittests can only be run at runtime: like testing file
>> I/O.  Obviously, other unittests can also be run at compile-time, so
>> it's useful to have both.
>
> I don't think the tests are supposed to be CTFE'd. They'd be
> compiled (to a temporary executable?) and then run normally.

Yah, that was my idea.

Andrei



More information about the Digitalmars-d mailing list