Only run code if *not* unittesting

Jared jared.online at gmail.com
Thu Nov 14 13:14:27 PST 2013


On Thursday, 14 November 2013 at 21:02:21 UTC, Adam D. Ruppe 
wrote:
> There's a version(unittest), so
>
> version(unittest)
> {}
> else
> {
>   /* only run when unittesting */
> }
>
> should work for you.

That worked... except backwards:

version(unittest) {
   /* executed when --unittest flag used */
} else {
   /* executed all other times */
}


More information about the Digitalmars-d-learn mailing list