I want to call some method if and only if the method is called from the unit test class. I have implemented following code for that:
#ifndef UNIT_TESTING
NSLog(@"inside unit testing");
#endif
this is not called when i am calling from the controller class . What should i do to so this loop is get called ? How can i set the macro to the UNIT_TESTING
In your unit test targeting build settings (in X-code), add the following to the “Preprocessor Macros Not Used in Precompiled Headers” option under the “Apple LLVM 3.1” section (or the equivalent GCC section if you are still using that):