Re: NSLog doesn't work with OCUnit
Re: NSLog doesn't work with OCUnit
- Subject: Re: NSLog doesn't work with OCUnit
- From: Chris Hanson <email@hidden>
- Date: Mon, 20 Jun 2005 17:44:42 -0700
On Jun 20, 2005, at 2:47 PM, Frank Midgley wrote:
But then the new Xcode 2.1 test bundle won't be loaded into your
app so no tests will run. Is there a recommended way of debugging
with Xcode 2.1's test bundles?
Here's something I wrote up on just this issue for the Xcode-Users list:
You'll need to set up your application executable in Xcode to support
this. You'll need to specify an argument and two environment
variables. You can do this by highlighting your application in the
Executables group of your Xcode project and getting info on it.
The argument you'll need to specify is "-SenTest All" - this
indicates to the testing framework that it should run all tests.
The environment variables you'll need to specify are
DYLD_INSERT_LIBRARIES and XCInjectBundle. You use
DYLD_INSERT_LIBRARIES to force a helper library we've supplied to
load into your application when it's launched. XCInjectBundle gives
that library the path to a bundle of unit tests to load. Here's how
you should set them:
DYLD_INSERT_LIBRARIES=/System/Library/PrivateFrameworks/
DevToolsBundleInjection.framework/DevToolsBundleInjection
XCInjectBundle=$(BUILT_PRODUCTS_DIR)/YourTestBundleName.octest
Once you do this, you should be able to set breakpoints in your unit
tests and then launch your application under the debugger. (Be sure,
of course, to use "Debug" rather than "Build & Debug" so you aren't
prevented from running under the debugger by unit test failures
during build.)
Hope this helps!
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden