I'm working in swift on Xcode and by default it creates a test file that references XCTest.
When I set the target membership to my main project it causes this error
Cannot load underlying module for XCTest
If this target membership is not set the tests runs properly and everything works fine.
The main project does not link with the XCUnit framework. You should create a separate testing target for your project, if one does not already exist, and add your test source files to that target.
If you are working on an iOS project template, select iOS > Test > iOS Unit Testing Bundle
.
If you are working on an OS X project template, select OS X > Test > OS X Unit Testing Bundle
.