It’s the same as for DEBUG, assuming that you’ve defined a build configuration that lists TEST
in the “Conditional compilation symbols” text box (under project properties > Build tab; this is a space-delimited list).
For code that you only want to run in the TEST build configuration:
#if TEST
// ...
#endif
And for code you don’t want to run in the TEST build configuration, you can either #else
the above, or do this:
#if !TEST
// ...
#endif