views:

55

answers:

1

Hi everyone,

I have just updated my XCode to 3.2.4 and it turns out my unit tests are no longer working. I have configured a target and executable following the instructions from Scott Densmore so that I'm able to debug my tests.

I did change the Base SDK to iOS4.1 for my test target (LogicTests) and updated the path to the otest script for my executable (otest).

However, even though my application runs in the iPhone simulator, executing the unit tests always crashes. Here's what the console has to say when I try to run the tests:

[Session started at 2010-09-15 23:28:37 +0200.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys014
Loading program into debugger…
Program loaded.
run
[Switching to process 12125]
warning: The target crashed on startup, maybe the shell is crashing.
"Try set start-with-shell 0" to workaround.

The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT).

I'd appreciate any help you might be able to offer! Thanks in advance.

Cheers, Georg

A: 

Totally just ran into this, too. Found I could get my tests to run by unchecking the DYLD_FORCE_FLAT_NAMESPACE environment variable. Seems to cause some awful problems. If I learn more on why, I'll post about it.

Truelson
Thanks Truelson. I switched back to the non-debuggable unit tests as proposed in the apple doc before I read your post. After a minor tweak (see http://gist.github.com/586296) they work again. Unfortunately I never committed the debuggable version so I could not try out your fix. Thanks a bunch anyhow. I'll remember to test it once I switch back to debuggable tests.
Georg Gruetter
By the way, I've discovered cedar and am using that instead of all the xcode hackery from before. See http://pivotallabs.com/users/amilligan/blog/articles/1267-bdd-style-testing-for-iphone-projects and search for "cedar bdd" for more details. It's a nice framework for running a testing executable, and I'm feeling pretty happy about it.
Truelson