• 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: Unit testing and Xcode integration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unit testing and Xcode integration


  • Subject: Re: Unit testing and Xcode integration
  • From: Chris Hanson <email@hidden>
  • Date: Sun, 13 Aug 2006 20:56:52 -0700

On Aug 13, 2006, at 6:32 PM, Christian Moen wrote:

On 8/14/06, Chris Hanson <email@hidden> wrote:
On Aug 13, 2006, at 8:13 AM, Christian Moen wrote:
> Is there a way to integrate the OCUnit test runs more tightly into
> Xcode?

It's not clear what you mean by "more tightly"?  What specific
capabilities are you looking for?

I'm looking for a tool which allows me to see the results of my unit test runs in a more accessible place than in the verbose Build Results window. To me this is hard to read, but perhaps it's just old habit. Is this what most people use?

This is the default behavior. The hooks exist for customizing it, by observing the appropriate notifications from within your test bundle, or by observing the appropriate distributed notifications from any application. Of course, the most important indicator is the one that says "Build Succeeded" which -- in the case of a unit test bundle -- also indicates that all tests ran successfully.


You still haven't articulated what "more accessible" might mean in regards to your unit test results.

See http://testkit.sourceforge.net/user/tools.html for TestKit's GUI
or terminal based test runners.  (TestKit is a third Objective C unit
test framework.)

You probably don't really want to simply load your test bundle into a "test runner" interface and press a button to run your tests. After all, you can't unload them and re-load them when you change your code. Instead, what you probably want is to either invoke /Developer/ Tools/otest or /Developer/Tools/RunUnitTests whether from the command line or from any graphical tool that you may build.


I'm new to SenTestingKit, but to me it's a mystery why this ended up
in Xcode instead of UnitKit.  :)

OCUnit is one of the most mature unit testing frameworks available, as it is a direct descendent of the original Smalltalk SUnit.


One difference that I do remember between OCUnit and UnitKit is that UnitKit used -init and -dealloc for not just memory management but also as an equivalent to -setUp and -tearDown. OCUnit (like SUnit and JUnit) explicitly avoids this, because test fixture creation and destruction needs to happen at deterministic points, whereas test case memory management is really not deterministic.

That said, if you want to use UnitKit with Xcode, go right ahead; nothing's preventing you, except perhaps the fact that unitkit.org appears to be down at the moment. The Xcode unit testing infrastructure also has support for invoking a test rig other than those for OCUnit and CPlusTest. Simply specify the path to an executable as the TEST_HOST for your project, and it will be invoked to run your unit test bundle with the path to your unit test bundle as its sole argument.

  -- 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


  • Follow-Ups:
    • Re: Re: Unit testing and Xcode integration
      • From: "Christian Moen" <email@hidden>
    • Re: Unit testing and Xcode integration
      • From: Tim Hart <email@hidden>
References: 
 >Unit testing and Xcode integration (From: "Christian Moen" <email@hidden>)
 >Re: Unit testing and Xcode integration (From: Chris Hanson <email@hidden>)
 >Re: Re: Unit testing and Xcode integration (From: "Christian Moen" <email@hidden>)

  • Prev by Date: Re: How do I know if a file is a system link?
  • Next by Date: Re: How do I know if a file is a system link?
  • Previous by thread: Re: Re: Unit testing and Xcode integration
  • Next by thread: Re: Unit testing and Xcode integration
  • Index(es):
    • Date
    • Thread