Chris Hanson has recently updated his
posts on debugging OCUnit test cases, because it's not as straight forward as you'd think. Especially when trying to debug unit tests in a framework. I'm not getting any unit tests failing on the GLSCollections framework right now, but I am getting this:
/Developer/Tools/RunUnitTests:314: error: Test rig '/Developer/Tools/otest' exited abnormally with code 139 (it may have crashed).
So Chris' posts may really help out in this case!
Also searching around I've found
this. I now know that it's a memory error causing this little error in otest. Now I just have to figure out what exactly I'm doing wrong.
--update - 5/17/2008 --
It seems that I'm getting quite a few hits from people looking for help debugging OCUnit Unit Tests. Here's what to do to enable the debugging of unit tests:
First add a custom executable to the project. Go to the
Projects menu and select
Add Custom Executable. Set the file name to otest and set /Developer/Tools/otest as the path to the executable.
Next, switch to the Arguments tab of the info pane. and add two arguments:
-SenTest Self and
MyBundleOfTests.octest where MyBundleOfTests is the name of your test bundle.
Next add two environment variables: DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH and set them to $(BUILT_PRODUCTS_DIR).
We're done with the info pane now so we can close it. Go back to the Project menu and set
otest as the active executable. Finally set some breakpoints and Debug your executable. Just remember not to do a build and run otherwise it will fail from the failed unit tests.
Thanks again to Chris Hanson for figuring all of this out.