• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: breakpoints ignored while running unit tests! Why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: breakpoints ignored while running unit tests! Why?


  • Subject: Re: breakpoints ignored while running unit tests! Why?
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 09 Sep 2008 15:30:56 -0700

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: breakpoints ignored while running unit tests! Why?
      • From: Pat McGee <email@hidden>
References: 
 >breakpoints ignored while running unit tests! Why? (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)
 >Re: breakpoints ignored while running unit tests! Why? (From: Philippe Casgrain <email@hidden>)
 >RE: breakpoints ignored while running unit tests! Why? (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)
 >Re: breakpoints ignored while running unit tests! Why? (From: Chris Hanson <email@hidden>)
 >RE: breakpoints ignored while running unit tests! Why? (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)
 >Re: breakpoints ignored while running unit tests! Why? (From: Chris Hanson <email@hidden>)
 >RE: breakpoints ignored while running unit tests! Why? (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)
 >Re: breakpoints ignored while running unit tests! Why? (From: Chris Hanson <email@hidden>)
 >Re: breakpoints ignored while running unit tests! Why? (From: Pat McGee <email@hidden>)

  • Prev by Date: Re: breakpoints ignored while running unit tests! Why?
  • Next by Date: Library not loaded - wrong path?
  • Previous by thread: Re: breakpoints ignored while running unit tests! Why?
  • Next by thread: Re: breakpoints ignored while running unit tests! Why?
  • Index(es):
    • Date
    • Thread