Re: Debugging iPhone unit tests (and debugging unit tests in general) on 3.2.1
Re: Debugging iPhone unit tests (and debugging unit tests in general) on 3.2.1
- Subject: Re: Debugging iPhone unit tests (and debugging unit tests in general) on 3.2.1
- From: Scott Thompson <email@hidden>
- Date: Tue, 23 Mar 2010 22:14:31 -0500
On Mar 23, 2010, at 9:58 AM, Paul Summermatter wrote:
> Is the problem in all of this that the iPhone cannot handle dynamically linked frameworks so that the whole approach to running unit tests has to be a bit of a hack?
Well, sort of. I mean obviously the iPhone handles dynamically linked frameworks without too much trouble. Otherwise, how would your application load the UIKit and Foundation frameworks (or the SenTestKit framework for that matter).
To my knowledge, however, the only mechanism that lets you, a third party developer, create a dynamically loadable bundle is as a unit test bundle. My guess is this restriction is similar to not having any language interpreters on the phone... they don't want you downloading executable code unless you go through the App Store. (either that... or it's something to do with code signing).
Personally what I've done is simply skip the "built-in" mechanism the XCode documentations give for running unit tests altogether. I simply compile the unit tests and link them directly into my application, then run them "manually" through the SenTestKit.
Before I run them, I set up my own test monitors (using SenTestKit) which let me create a nice window with the unit test results right there (lovely red and green areas to show the number of failed or successful tests and the like).
The down side is that the unit tests only run when I run the application instead of on every build, but since they're just code like any other code in the application they are straightforward to debug and they run equally well in the simulator or on device. My unit test code is commented out for Release using preprocessor macros... which is a little distasteful, but it works.
Scott
_______________________________________________
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