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: Sat, 5 Nov 2005 16:37:16 -0800
On Nov 5, 2005, at 4:23 PM, James Bucanek wrote:
The documentation seems to hint that a "dependent" unit test can be
configured to load the actual application executable as if it were
a dynamic library, link the unit tests to that binary code, and
execute the tests. This is referred to as "bundle injection."
Whether tests are dependent is orthogonal to whether bundle injection
takes place. Dependent tests are tests that are kept separate from
the code under test, whether it's an application, tool, or
framework. Bundle injection takes place when testing applications or
tools.
Also, bundle injection doesn't quite work the way you describe. It
launches the application (or other executable) in a special
environment and injects the unit test bundle into it dynamically,
which in turn executes the tests.
However, the only example of doing this demonstrates using a
bundled app with a TEST_HOST of $(BUILT_PRODUCTS_DIR)/MyApp.app/
Contents/MacOS/MyApp. I've tried to set the TEST_HOST to my command-
line executable at $(BUILT_PRODUCTS_DIR)/MyTool without success.
As far as I know, this should work. What kind of failure are you
seeing? Did you also set the BUNDLE_LOADER for your test bundle to
the path to MyTool?
Does this technique only work for bundled apps? Is there some way
of doing this for other kinds of executable products, or must I
compile the code seperately in the unit test target? I can find no
documentation for otest or the RunUnitTest scripts that explain how
they load and execute their tests. I know it's supposed to "just
work," but in this case I'm afraid I need to know.
There are man pages for otest and RunUnitTests. Setting your
TEST_HOST to an executable should work, and a more detailed
description of the failure you're seeing will help diagnose it.
-- 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