I'm running Xcode 6.1.1. I setup a new test target using: File > New > Target
Running the test with the empty template works fine. I import a single header, ServerController
, and tried to make an instance:
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "ServerController.h"
@interface Tixie_Tests : XCTestCase
@end
@implementation Tixie_Tests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
ServerController * s = [[ServerController alloc] init];
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end
Now running the tests gives me this:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ServerController", referenced from:
objc-class-ref in <omitted>.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)