• 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: otest -- only useful for bundles?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: otest -- only useful for bundles?


  • Subject: Re: otest -- only useful for bundles?
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 22 Nov 2005 14:16:09 -0800

On Nov 22, 2005, at 8:40 AM, James Bucanek wrote:

So to answer the framework/library question: A dependent unit test bundle that tests a framework or library should be configured exactly as one would configure any client or application that used that library. (i.e. add the library to the target, include the correct headers, etc.)

Yes, exactly.

OK -- and for my personal edification -- the sequence is this:

1) Application is loaded.
2) DYLD_ environment variables cause a special testing framework to be loaded in addition to the normal dynamic libraries the application was linked to.
3) When initialized, the testing framework looks for, and loads, the test bundle into memory as well.
4) Application and test bundle are both initialized (dynamically linked, static initializers run, etc.)
5) Initialization of the test bundle is used to intercept the application's normal execution.
6) The test bundle then runs all tests and exits.

Yes, exactly.

For step 6, typically the test bundle (or a framework it's linked against) installs some code in the application that will cause the tests to be run at a known point. The example in the Xcode Unit Testing Guide is of a Carbon Timer, which is set to run the next time through the application's event loop. This way tests aren't run at library or static initialization time, but are instead run in a more "normal" environment within the application.

  -- Chris

_______________________________________________
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: 
 >Re: otest -- only useful for bundles? (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: Project checkout vs. Perforce SCM
  • Next by Date: Re: otest -- only useful for bundles?
  • Previous by thread: Re: otest -- only useful for bundles?
  • Next by thread: Crash of GDB
  • Index(es):
    • Date
    • Thread