[phobos] Unittest errors on windows with latest phobos sources

Steve Schveighoffer schveiguy at yahoo.com
Tue Jul 6 11:19:43 PDT 2010


version(unittest)
{
   void main() {}
}
else
{
   int main(string[] args)
   {
      ...
   }
}

FWIW, I never want to run my application when running unit tests.

-Steve

----- Original Message ----

> From: Sean Kelly <sean at invisibleduck.org>
> To: Discuss the phobos library for D <phobos at puremagic.com>
> Sent: Tue, July 6, 2010 12:12:57 PM
> Subject: Re: [phobos] Unittest errors on windows with latest phobos sources
> 
> On Jul 6, 2010, at 9:05 AM, Michel Fortin wrote:

> Le 2010-07-06 à 
> 11:28, Sean Kelly a écrit :
> 
>> On Jul 5, 2010, at 11:35 PM, 
> Walter Bright wrote:
>>> 
>>> Sean Kelly 
> wrote:
>>>> That's probably my fault.
>>> 
> 
>>> Every team needs one of those people. Thanks for filling that 
> role.
>> 
>> I like to maintain a steady level of failure to 
> keep things positive ;-)
>> 
>> How about this... the unittest 
> handler only returns an error code and if it's nonzero then the app won't 
> run.
> 
> This is what I was expecting the change would do 
> originally. Running the program should be conditional to the unit tests being 
> successful, otherwise it's too easy to ignore them.
> 
> Another way 
> to put it is: do you want your failed unit tests to behave as warnings or as 
> errors? I choose errors.

Yeah, the only thing I've been wondering about 
> is whether there's a case where the unittests would want to return 0 but have 
> the app still not run.  I thought maybe with a custom build meant to run 
> unit tests, but in that case I'd have an empty main() that simply returned 0 and 
> would specify that main should run.  Still trying to decide whether there 
> are any justifiable cases that the new behavior wouldn't 
> cover.
_______________________________________________
phobos mailing 
> list

> href="mailto:phobos at puremagic.com">phobos at puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos


      


More information about the phobos mailing list