当我尝试运行Xcode中的默认单元测试时,构建失败。
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测试。
任何帮助都会非常感激,我已经拉出了剩余的头发。
答案 0 :(得分:2)
您不小心添加了OS X测试用例(由于import Cocoa
,您可以看到这一点)。有时会发生这种情况,因为Xcode选择了错误的来源。
当您向项目添加测试时,请确保这些是iOS测试。