• 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: NSZombieEnabled when running unit tests
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSZombieEnabled when running unit tests


  • Subject: Re: NSZombieEnabled when running unit tests
  • From: "A.M." <email@hidden>
  • Date: Wed, 19 Aug 2009 14:42:12 -0400


On Aug 19, 2009, at 9:52 AM, Paul Summermatter wrote:

Folks,

I'm sure I'm missing something stupidly obvious, but I cannot figure out how to specify arguments when running unit tests. Specifically, I want to turn on NSZombieEnabled. With applications, I have used the Executable inspector panel in Xcode to configure arguments. However, with unit tests, there doesn't seem to be an executable. What am I missing?

Hi Paul,

I had to figure out how to do this so that 1) I would be able to debug the unit test failures, 2) I could run the unit tests manually and individually. A good portion of this technique I gleaned from Chris Hanson's blog, but the approach is slightly different.

http://chanson.livejournal.com/119097.html

Here are the steps I took:

1. Create a custom executable "otest" with path "/Developer/Tools/ otest".

2. Get Info on "otest" and add the arguments:
* "-SenTest Self" if you wish to run all the tests
* "-SenTest *UnitTestClassName*/*methodName*" if you wish to run only one test
* tack on the name of the unit test bundle so that otest can find it: "UnitTest.octest" (this is the build product of the unit test target)
* Tip: If you have a lot of tests, add them all to the arguments table and then use the check boxes to control which one will get run


3. Add the environment
Name = Value
* DYLD_LIBRARY_PATH = $(BUILT_PRODUCTS_DIR)
* DYLD_FRAMEWORK_PATH = $(BUILT_PRODUCTS_DIR) **because this is test for a framework in my case**
* OBJC_DISABLE_GC = YES **disable garbage collection in otest
* NSZombieEnabled = YES **what you requested**


Then change your current executable to "otest" and your target to the unit test bundle target and start debugging as usual.

Cheers,
M
_______________________________________________
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


  • Follow-Ups:
    • Re: NSZombieEnabled when running unit tests
      • From: Paul Summermatter <email@hidden>
References: 
 >NSZombieEnabled when running unit tests (From: Paul Summermatter <email@hidden>)

  • Prev by Date: Re: NSZombieEnabled when running unit tests
  • Next by Date: Re: Double-clicking XIB files
  • Previous by thread: Re: NSZombieEnabled when running unit tests
  • Next by thread: Re: NSZombieEnabled when running unit tests
  • Index(es):
    • Date
    • Thread