On Sep 9, 2008, at 2:11 PM, Pat McGee wrote: I appear to be having what looks like the same problem. I'm not sure what's happening, but it looks like somewhere, we're not communicating clearly. I say one thing, and other people seem to think it means something different; you say something, and I seem to read it to be different than what you meant.
In the interests of clearer communication, could you please clarify what you meant by "explicitly debug"?
When I read this, what I think you mean is to do the following: 1) Select the unit test target (which I defined using the instructions from Xcode: Debugging Cocoa application unit tests, or at least I think I did.)
What do you mean by "select the unit test target"?
Do you mean "highlight the unit test target in the Groups & Files tree" or do you mean "set the Active Target to the unit test target"? 2) Click the "Build" button. 3) Under the Run menu, select the third item, "Debug"
When I try that, what it does is to run the application in the debugger, just like when I had the target set to the application, not the tests.
That is because targets are not run or debugged, executables are run or debugged. You need to set the Active Executable to the executable you wish to debug, then Debug will cause that to be run under the debugger and you should hit breakpoints in it. When I do things in the app, I hit the breakpoints in the app. The unit tests don't run and I don't hit the breakpoints I set there.
Since that's not what you said it should do, either I'm misreading something you wrote, or I've screwed up something else.
It sounds like you have your unit tests set up to be injected into your application, in order to test your application code. You need to add additional arguments and environment variables to the application's executable; when you do that, debugging the application should also cause your unit tests to be loaded and debugged, and breakpoints within them to be hit.
If you have your application's executable set up for debugging your unit tests, but you aren't hitting breakpoints, look in the Debugger Console in Xcode and see if there are any errors or warnings relating to your unit tests (for example, saying that your test bundle could not be found). That could indicate that you have an incorrect path somewhere.
-- Chris
|