views:

27

answers:

1

I am writing unit tests for an app for iPhone using objective c. I want to use some variable only when compiling for test case for example

#ifdef UNIT_TESTING 
@synthesize requestFinished, networkAvailable;//etc
#endif

now where should I define UNIT_TESTING that when I compile for unit tests it should enter this code block.... otherwise should go past it....

+2  A: 

Define it in the “Preprocessor Macros” build setting in each of your targets—especially the one where you want that macro defined, the unit test bundle target.

Peter Hosey
Bravo Peter it worked like a charm... Can you please give your views on this too... http://stackoverflow.com/questions/3962705/error-compiling-for-unit-test-using-google-toolbox-for-mac .... Thank you
Asad Khan