[dmd-internals] changeset 455

Walter Bright walter at digitalmars.com
Mon May 3 16:01:21 PDT 2010



Andrei Alexandrescu wrote:
> Walter Bright wrote:
>>
>>
>> Andrei Alexandrescu wrote:
>>> Since we've been looking into this now and we have a solution in our 
>>> collective mental caches, is there please a chance to effect this 
>>> change for this beta? I'm telling you, it is an _important_ step 
>>> forward in unittesting D programs.
>>>
>>
>> One thing I should mention is that dmd now calls a different function 
>> for unittest asserts than the asserts normally do, and it does not 
>> regard those calls as "terminating" calls. This means that the 
>> unittest behavior can now be controlled by adjusting the runtime 
>> library, without affecting the assert failure code.
>
> In light of Sean's latest discovery, I'm afraid there's an issue here. 
> The asserts are only replaced syntactically at top-level unittests. My 
> understanding was that there was a "unittest stage" global that 
> dictates how assertion failures are handled, regardless of origin.
>
> I'm unclear on what the best policy is. Experience suggests that flat 
> == bad.
>

I'm reluctant to transform all asserts because:

1. this means all asserts, whether meant for unit testing or not, have 
to have return code, negatively affecting optimization all the time

2. many asserts are not meant at all to be unit tests, and there's no 
reason to think otherwise when they are outside the unittest block



More information about the dmd-internals mailing list