Re: unit testing...
Re: unit testing...
- Subject: Re: unit testing...
- From: Bill Dudney <email@hidden>
- Date: Fri, 28 Dec 2007 06:11:18 -0700
Hi Chris,
Thanks for the response and I am indeed using Xcode 3.0 sorry for not
specifying before.
So adding DYLD_FALLBACK_FRAMEWORK_PATH to my arguments worked
partially. Despite no GC in my tests or the app I still had to add
'set start-with-shell 0' to my .gdbinit. I have both my tests bundle
and my executable building with 'Unsupported' in the GC section of my
build options, is there somewhere else I could have specified to use GC?
Did I miss this in a doc somewhere? I spent quite a bit of time
googling about it and came up with only your blog entries and a
similar time frame doc from ADC. I'd be glad to file a bug on better
docs for this in XCode 3 if it would help.
Also I'd really like to fully understand this if you have the time to
explain it.
- From reading the docs on DYLD_FALLBACK_FRAMEWORK_PATH seems like I
could have used DYLD_FRAMEWORK_PATH, but when I tried to use this var
all I got was crashes. I had DYLD_FRAMEWORK_PATH set to $
(DYLD_FRAMEWORK_PATH):$(DEVELOPER_LIBRARY_DIR)/Frameworks.
- What does start-with-shell do? The docs from gdb help say 'Set if
GDB should use shell to invoke inferior (performs argument expansion
in shell)'. I think what that means is that if start-with-shell is
true then GDB will fire off a shell to execute the debugged program
and therefore the inferior shell will have env expansion done and the
executable will get a 'fresh' env. If start-with-shell is set to false
then gdb will exec the program internally and therefor no new 'fresh'
env. If I got that correct... What is Xcode doing to inject a GC-
required bundle if we leave start-with-shell unset. As I understand it
Xcode/gdb should not be using otest since its using my app as a host.
I thought I understood what is going on here but now I'm not so sure...
For framework projects I'm assuming I could use the instructions in
your blog and the dyld fall back var and run and debug my tests. Is
that a valid assumption?
Thanks again!
-bd-
On Dec 27, 2007, at 6:56 PM, Chris Hanson wrote:
On Dec 27, 2007, at 9:55 AM, Bill Dudney wrote:
I am unable to get unit testing to happen on a very simple
application.
Steps:
1) Create Unit Testing Bundle (called UnitTests in the attached
project)
2) add the app as a dependency
3) switch to the unit test bundle as the active target
4) specify Bundle Loader and Test Rig to be the application
executable for the unit test target
5) add the -SenTest All argument to the Executable (called DizBot
in this example)
6) add DYLD_INSERT_LIBRARIES = $(DEVELOPER_LIBRARY_DIR)/
PrivateFrameworks/DevToolsBundleInjection.framework/
DevToolsBundleInjection and XCInjectBundle to UnitTests.octest to
the variables
When I build and go i get;
There's one more step you need, assuming you're using Xcode on
Leopard (since you didn't specify):
7) Add a DYLD_FALLBACK_FRAMEWORK_PATH entry to your executable's
environment variables, and specify $(DEVELOPER_LIBRARY_DIR)/
Frameworks as its value.
This will be used to resolve the @rpath-relative install path used
for SenTestingKit.framework.
If your tests are GC-required, you will also need to add "set start-
with-shell 0" (without quotes) to your ~/.gdbinit file, to avoid
Xcode trying to inject the (GC-required) test bundle into the shell
gdb uses to sub-launch 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