• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSLog doesn't work with OCUnit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSLog doesn't work with OCUnit (From: Simon Strandgaard <email@hidden>)
 >Re: NSLog doesn't work with OCUnit (From: Simon Strandgaard <email@hidden>)
 >Re: NSLog doesn't work with OCUnit (From: Simon Strandgaard <email@hidden>)
 >Re: NSLog doesn't work with OCUnit (From: Corbin Dunn <email@hidden>)
 >Re: NSLog doesn't work with OCUnit (From: Finlay Dobbie <email@hidden>)
 >Re: NSLog doesn't work with OCUnit (From: Corbin Dunn <email@hidden>)
 >Re: NSLog doesn't work with OCUnit (From: Frank Midgley <email@hidden>)

  • Prev by Date: Resizing image with slider
  • Next by Date: Re: How to trap for the delete key in NSOutlineView?
  • Previous by thread: Re: NSLog doesn't work with OCUnit
  • Next by thread: initWithHTML problems
  • Index(es):
    • Date
    • Thread