Some notes and pictures to remind me how to do this in XCode.
Create a new command line project.
Hit that ‘+’ sign in the lower left hand corner to add a new target.
Create a Test Bundle target.
Give it a name
Clicking the Unit Test section,
And then selecting your newly created test target.
Should now look something like this.
Should now be able to go Command+U, run your tests and all should be good.
If you get an error message (linkage error) that looks something like this
It’s because we need to do this annoying thing, which is flag each class we want to be accessible in our test suite.
Goto the offending file that can’t be found, and on the right hand side open you options slider, and tick the ‘Test’ Target relationship. That will make your project file available to your tests.