Re: otest -- only useful for bundles?
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