I have a simple Mac OS X Command Line Tool project in Xcode 4.5. I manually added a unit test target off of the Cocoa Unit Testing Bundle template (the Command Line Tool template doesn't have an Include Unit Tests switch). The problem: I can't get the debugger to stop on a breakpoint when running tests (Product > Test).
As I did a google search before asking, these are some things I already tried/checked:
What else can I do to hit a breakpoint in my unit tests?
Check your "Test after build" build setting (under "Unit Testing") for your unit testing target.
If this setting is set to "Yes" then after your target is built the tests will be executed through a shell script "outside" of Xcode before being executed (again) via Xcode. So if your tests are failing when the script is being executed then the second execution ("inside" Xcode) will not occur and so your breakpoints will not be hit.
-or-
If the test you are trying to debug is a failing test, it's possible that failure is occurring in your -setUp method. This might happen if you are using OCMock in your setUp and you have forgotten to stub a method that happens to be called during the setup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With