Hi Chris, Thanks very much for this reply. I see major progress here. You said a couple of things that came across as complete gibberish. Which is my clue that I've completely misunderstood some major point. I think one or two more questions and I'll understand. And I hope this will solve Cem's issue also.
When I said "select the unit test target", I meant the second of your alternatives: set the Active Target to the unit test target.
Thanks to your explanation, I'm more clear on what gets debugged. What I still don't know is how to set up the executables I need.
1) When you say "set the Active Executable to the executable you wish to debug", I don't see what user actions I could take to do that. I see two things I can choose: Active Target, and Active Build Configuration. When I open the Debugger console and mouse-down on Overview, I see choices for Active SDK, Configuration, Target, Executable, and Architecture. Of these, I have two choices on all except Executable, where I have only one choice.
This might be because I see another issue:
2) I have only one executable. That is, in the Smart Group "Executables", there is only one thing, which is "MyProject". This is the one in whose Info window I set the argument "-SenTest All" and the four environment variables: DYLD_FALLBACK_FRAMEWORK, DYLD_INSERT_LIBRARIES, XCInjectBundle, and XCInjectBundleInto.
If I'm supposed to have two different executables, then I don't know how to create a second one. I've reviewed the instructions that I thought were relevant, and if it's in there, then I didn't understand it.
(Per your suggestion, I did check the debugger console again, and verified that there really were no error messages.)
OK, does that help pinpoint what I got wrong?
Thanks,
Pat
P.S. When I get this right, I want to post a set of detailed user actions and a skeleton project. I like making the trail nicer for people who come after me. And I really appreciate you breaking the trail for the rest of us. P.M.
On Sep 9, 2008, at 6:30 PM, Chris Hanson wrote: 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
-- "Save the Earth; it's the only planet with Chocolate!"
Pat McGee
|