【发布时间】:2015-05-07 10:30:37
【问题描述】:
当我尝试在 Xcode 中运行 Swift 项目的默认单元测试时,构建失败。
import Cocoa
import XCTest
class Test2: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
这发生在我自己的 MBP 和我的雇主提供的 MBP 上。我不禁想到这与项目设置有关。
适用于 Objective-C 测试。
任何帮助将不胜感激,我已经把剩下的头发拔掉了。
【问题讨论】:
-
是 iOS 还是 OS X 项目?
-
这是一个 iOS 项目。奇怪的是,我刚刚创建了一个空白的 iOS 项目,空白单元测试一切正常。所以我会重新创建我的项目,看看是否可行。
标签: objective-c xcode swift xcode6