Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyone successful in debugging unit tests for iPhone?

I found examples on how to debug your unit test in Cocoa or the ADC page here. But I can't get the debugging to work for an iPhone app target. I can get the tests up and running and they are run during the build, but what I need is to debug the tests for some of the more complex failures.

like image 250
Remus Rusanu Avatar asked May 23 '09 00:05

Remus Rusanu


2 Answers

You might consider moving your tests to GHUnit, where they run in a normal application target, so debugging is straightforward.

like image 102
pokeb Avatar answered Sep 27 '22 22:09

pokeb


This can be done by setting up a separate Executable for the project that uses the otest tool to run the unit tests, after setting a bunch of relevant environment variables for the executable. I have used this method to successfully debug SenTestKit logic unit tests.

I found the following links helpful:

http://www.grokkingcocoa.com/how_to_debug_iphone_unit_te.html (also contains help to fix common errors encountered setting up the project).

http://cocoawithlove.com/2009/12/sample-iphone-application-with-complete.html (covers both logic tests and application tests)

http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/otest.1.html (Man Page for otest XCode tool)

like image 27
beno Avatar answered Sep 27 '22 23:09

beno