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 22:41:57 -0800
On Nov 5, 2005, at 9:38 PM, James Bucanek wrote:
Yes they do, and I read them. But they don't really say anything
beyond what the basic Unit Testing docs do. I was trying to find
out *how* the otest tool did it's magic, not just what parameters
to pass.
Ah. When running dependent unit tests for a command-line tool or
application, otest isn't actually involved. It's only used when
you're running unit tests for a framework, since something needs to
actually load the framework in order to test it.
My command-line tool, however, still doesn't run any tests. When I
build it (the unit test target), I get the following:
/bin/sh -c
//Users/james/Desktop/PrimesObjC/build/PrimesObjC.build/
Release/
/PrimesToolTest.build/Script-1A249CB5091D75C300B763AB.sh
2005-11-05 22:05:36.764 PrimesObjC[5740] CFLog (21): Cannot
find executable for
CFBundle 0x302ee0
</Users/james/Desktop/PrimesObjC/build/Release/
PrimesToolTest.octest> (not
loaded) DevToolsBundleInjection: Error loading bundle
'/Users/james/Desktop/PrimesObjC/build/Release/
PrimesToolTest.octest'
2005-11-05 22:05:37.294 PrimesObjC[5740] There are 11301 prime
numbers between
2 and 120000, inclusive
/Developer/Tools/RunUnitTests: line 182: 5740 Trace/BPT trap
/"${TEST_HOST}" ${TEST_HOST_FLAGS}
Ah. Does your PrimesToolTest target actually have any sources
associated with it? And does the name of the generated executable
match the CFBundleExecutable key in the test bundle's Info.plist file?
This sounds like what would happen if PrimesToolTest.octest isn't
building an executable, or if the name of the binary it's generating
doesn't match the CFBundleExecutable key in the bundle's Info.plist
file.
I just tried this with a simple Foundation tool project, and I get a
similar failure to the one you describe when I don't have any tests
in my test project and when I change the name of the bundle
executable in the Info.plist without changing what the target generates.
I suspect that otest doesn't have anything to sink its claws into.
Actually, even when not used via otest (which it what's going on in
the case of apps & tools) SenTestingKit.framework will still manage
to check for whether it needs to run tests and do so if requested.
Or, maybe I've got some magic linker setting that's wrong. If I
knew *how* otest injects the tests into the application it
launches, then maybe I'd have a clue as to what needs to be changed
to let otest work its mojo.
Thanks in advance for any insight you might have.
Hope this helps! If not, please file a bug at <http://
bugreport.apple.com/>.
-- 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