Created a new OS X library project, deleted the Objective-C stubs and add a Swift file (Empty.swift). In the same directory, added a unit test (new->Unit Test), EmptyTest.swift. The code generated won't compile because this OS X library project doesn't know how to resolve the dependency to XCTest.
XCTest is at this location /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/XCTest
The solution for command line tools is here (How can I run XCTest for a swift application from the command line?). How to add the dependency using Xcode 7?