octest

How do I link my executable to my test bundle when debugging test using otest?

I'm using kind of a hybrid of Chris Hanson's excellent Xcode unit testing guide. My program is a (command-line) application (which precludes using the executable itself to run the tests), but I need to be able to debug my unit tests. So what I have is as follows: Create test bundle and tests. Create new test target, set bundle loader ...

XCode missing inline test results

Everywhere there are pretty pictures of failing tests shown inline in the code editor, like in Peepcodes Objective-C for Rubyist screencast and in apples own technical documentation: When I build my test-target, all I get is a little red icon down in the right corner, stating something went wrong. When clicking on it, I get the Build...

Why can't code inside unit tests find bundle resources?

Some code I am unit testing needs to load a resource file. It contains the following line: NSString *path = [[NSBundle mainBundle] pathForResource:@"foo" ofType:@"txt"]; In the app it runs just fine, but when run by the unit testing framework pathForResource: returns nil, meaning it could not locate foo.txt. I've made sure that foo.t...

How can iPhone Nibs be Unit Tested using Logical Tests?

Unit Testing View Controllers seems to be very important part of iPhone Development (see this Article). This, however, requires initializing the Controllers from a Nib, which I found impossible to do properly in a logical test. Loading Resources from a Bundle (see this Question) in a logical test works fine. Even loading Nibs is possibl...

Unit tests no longer working after XCode upgrade from 3.2.3 to 3.2.4

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 scrip...