UITesting + preprocessor macross

Hello,


I had some isuee with my project.

I had project with multiple targets. In project settings every target has some preprocesor marco, which one I recognize in my code (objective-c), and based on this personalize my target.

I would like to use some UITest, and when I recorde test there is no problem, xcode recognize target and show right content. But when I start to run my test (Cmd + U), xcode wouldn't see any preprocessor macros.

I even add this same macro to my test target, but it's change anything.


Could you help me with this problem?


Greg

It also happens to me, on test target, no preprocessor macros could be found when running tests.

Looks like this is regression from previous versions of xcode, as I've been seeing some old posts showing that working.

I believe you mean "environmental variable", not "preprocessor macro"? If so, what you describe is the expected behavior. When you run your app, which is what we do when you record it, it takes its environment from the configuration for the run action in the scheme. When the app is launched from the test you can supply environment variables using the API in XCUIApplication, but they're not populated by settings for the run action of the scheme.

No, I really meant preprocessor macro.

UITesting + preprocessor macross
 
 
Q