Sunday, March 29, 2009

SenTestingKit "no such file or directory"

When trying to add unit tests to your Xcode project, there's some very useful information on setting up Xcode for unit testing on the Apple site, but one key piece of information is missing - you may need to manually add the SenTestingKit.framework to your project. Otherwise you'll end up with errors such as 'SenTestingKit no such file or directory' when trying to build your test project.

Add the framework from the context menu on the Frameworks icon. SenTestingKit.framework should be in /Developer/Library/Frameworks. Make sure that you only link it to your test target and not your core project, as this can cause you more problems when trying to run the core project.

When running the tests, failing tests are reported in the standard "Errors and Warnings" section of Xcode, just to confuse you...

Actually, since writing the above, I've found a much better overview of unit testing in Xcode which does cover the points I made above.

2 comments: