I am keen to write a library project with tests, even if I then include the code in other projects (as opposed to linking to the lib.) for inclusion on ios projects.
It seems checking the ‘Include unit tests’ isn’t enough for xcode 4 to properly initialise a project with tests, and after looking through the Apple documentation I can’t find anything relevant.
Does anybody know of any resources or tutorials for getting this working?
Even with the default Cocoa Touch Static Library project, upon choosing “Test” from the “Product” menu, it fails (when linking) with this error (the project is called test1):
library not found for -ltest1
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
Any help would be much appreciated.
OK I finally got this working.
The trick was to create the library without checking the ‘Include unit tests’ option in XCode 4. Then I created a new target myself.
(in xcode 4)
I hope this helps.