Unit tests should be debuggable with no manual configuration

Originator:ddribin
Number:rdar://7215100 Date Originated:10-Sep-2009 10:58 PM
Status:Duplicate/5990080 Resolved:
Product:Developer Tools Product Version:
Classification:Enhancement Reproducible:
 
Debugging unit tests is a pain.  Chris Hanson has full instructions on his blog:

  <http://eschatologist.net/blog/?p=26>

This has a couple problems.  First, it's a lot of steps to do.  It's not easy to remember all these steps from memory.

Second, it modifies your application's executable environment.  Thus, it makes it hard to switch back and forth between debugging/running unit tests and debugging/running your app.  One way around this is to create a custom executable.  In either case, this information is stored in the per-user Xcode file, so every developer must follow these instructions.

Also, if you want to debug dependent tests, you must create a custom executable that launches otest.  This, again is stored in the per-user Xcode file, so every developer must do this.

All these options are a big hassle and an impediment to writing unit tests.  There should be some no muss, no fuss way to debug unit tests just by hitting Command-Y.  Perhaps adding a unit test bundle to your project would create an executable that can be run and debugged with the standard Command-R and Command-Y commands.

Comments

Not to mention on the iPhone...

... where you have to delve in the unit test runner script to grab the various DYLD_* vars you need to run otest with Simulator frameworks as your executable. Ick!


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!