• 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: Can't debug unit test
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't debug unit test


  • Subject: Re: Can't debug unit test
  • From: David Bainbridge <email@hidden>
  • Date: Thu, 31 Jul 2008 16:53:00 -0500


On Jul 27, 2008, at 10:58 PM, Tron Thomas wrote:

I'm using Xcode 3.1, and I'm trying to debug a Objective-C unit test written with OCUnit. Despite setting what should be the appropriate environment variables Xcode never hits the break points I set. The application simply runs to completion.

What could possibly be needed to allow debugging of the unit test?


Chris Hanson's directions are not up-to-date for 3.1. If you browse through the comments you will find an anonymous poster who mentions what you need to do. In 3.1 you also need to add an environment variable XCInjectBundleInto which is the full path to the executable. The DevToolsBundleInjection will also log a message to the debug console informing you that you need to specify the XCInjectBundleInto environment variable if it was not specified.


For quick reference you need to do the following:

Add the argument "-SenTest All" to the executable.

Add the following environment variables to the executable:

Name: DYLD_INSERT_LIBRARIES
Value: $(DEVELOPER_LIBRARY_DIR)/PrivateFrameworks/ DevToolsBundleInjection.framework/DevToolsBundleInjection


Name: DYLD_FALLBACK_FRAMEWORK_PATH
Value:$(DEVELOPER_LIBRARY_DIR)/Frameworks

For the following two environment variables I would suggest specifying the entire path in the value to verify that debugging works. After you verify that you can break on breakpoints in your test cases then you may wish to substitute with the appropriate environment variables.

Name: XCInjectBundle
Value: /Volumes/Backup/TestUnit/build/Debug/Tester.octest <- change this to your path


The Following environment variable is new in 3.1 and not mentioned in Chris Hanson's instructions as of this writing.
Name: XCInjectBundleInto
Value: /Volumes/Backup/TestUnit/build/Debug/TestUnit.app/Contents/ MacOS/TestUnit <- change this to your path


With the active target the Unit Test Bundle you created, active build configuration of Debug, and active Executable the one you specified the above environment variables and arguments for, select Debug from the Run menu. It should now stop on any breakpoint you have in your test cases.

_______________________________________________
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
References: 
 >Can't debug unit test (From: Tron Thomas <email@hidden>)

  • Prev by Date: Re: Xcode's Editor losing text encoding
  • Next by Date: Turning off xcodebuild/gcc verbose
  • Previous by thread: Re: Can't debug unit test
  • Next by thread: [OT] How do you pronounce .xib?
  • Index(es):
    • Date
    • Thread