#ifdef in tests
#ifdef in tests
- Subject: #ifdef in tests
- From: "Reaves, Timothy" <email@hidden>
- Date: Sun, 22 Apr 2012 11:25:02 -0400
I have this code in my app delegate:
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
#ifdef TEST
return mockPersistentStoreCoordinator;
#else
return realPersistentStoreCoordinator;
#endif
}
The intention is to return a different NSPersistentStoreCoordinator based on if this is the tests target, and the Test scheme. I have a Test.pch for my test target, that defines TEST. The pch file also has some imports. My tests import this file, as they would not compile otherwise. The problem is, my app delegate does not. When I set a breakpoint, it always hits the second line.
I have tried to add -DTEST to the 'Other C Flags', and it still does not hit. I've cleaned the code, all to no avail. If I ad this code to one of my tests, it does hit there. So how do I actually get my application code to see the value, either in the PCH file or in the 'Other C Flags' area? This should be a very simple configuration issue.
Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden