• 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: Frank Midgley <email@hidden>
  • Date: Mon, 20 Jun 2005 19:13:30 -0500

On Jun 20, 2005, at 6:01PM, Corbin Dunn wrote:

I was able to hack this up by testing for -SenTest in the arguments in main() and then manually loading the bundle and testing framework.
I was hoping Xcode/OCUnit would be able to do this for me.



It will do it. Just use otest as your host to run your bundle.

Still not working. Setup for debugging unit tests:

Unit testing bundle target (with default build script disabled so it doesn't run during build)
Contains unit test classes but NO classes from the app.
Application target dependent on unit test target (opposite of build- time dependency)
Custom executable:
Executable path: "/Developer/Tools/otest"
Arguments: "-SenTest Self $(BUILT_PRODUCTS_DIR)/TestBundle.octest"
Active target: app target
Active executable: custom executable


When this is debugged otest crashes the first time that one of the unit test classes tries to alloc/init one of the classes from the app. Since those classes were never loaded this isn't too surprising.

This setup worked fine when building (with the unit test target dependent on the app and the script enabled) once I set the Test Host to be the app. It's just when you want to go debug one of the failed tests that it's a problem.

It looks like the script (/Developer/Tools/RunUnitTests) handles injecting the bundle into your app so that the classes can co-exist during the build-time testing. The hack I put together effectively does this in the debug case but I'd prefer to use built-in functionality if it's available.

-Frank

------------------------------------
Frank M. Midgley
email@hidden
http://homepage.mac.com/knarf/


_______________________________________________ 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>)
 >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: Re: Strange NSArray problem
  • Next by Date: Resizing image with slider
  • Previous by thread: Re: NSLog doesn't work with OCUnit
  • Next by thread: Re: NSLog doesn't work with OCUnit
  • Index(es):
    • Date
    • Thread