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.
PS: I'm new to swift and it's probably a dumb question (please enlighten me)
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 > Other > Cocoa Touch Testing Bundle.
If you are working on an OS X project template, select
OS X > Other > Cocoa Testing Bundle.