Create new command line project

create-new-command-line-project

Add new test target by clicking ‘+’ sign in the white area under Targets (Foo)

add-new-target-1

And then selecting ‘Cocoa Testing Bundle’

add-test-target1

add-test-target-2

Edit your project scheme

edit-scheme-1

Select the ‘Test’ scheme

select-test-scheme

Hit the ‘+’ sign again, and select your test bundle.

select-test-bundle

select-test-bundle-2

Open logging window (Shift + Command + Y)
Command + U show now run all the tests.

tests-run

Voila!

Note: Whenever you add any new project files, you will need to include them in the test target (command line tool apps only).

target-member-ship

target-membership-2