【发布时间】:2015-12-25 19:24:04
【问题描述】:
我正在尝试将测试目标添加到我的项目中,但是当我运行测试时,似乎没有执行实际测试,而是 Xcode 总是报告成功,但小方块表示测试是否通过或不清楚。
我只有一个测试目标和一个类:
@implementation Tests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (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.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssert(false, "");
}
- (void)testPerformanceExample {
XCTAssert(false, "");
}
@end
测试应该失败,但会显示一个弹出窗口说成功。此外,测试报告说没有测试。
如果我尝试单独运行测试,则测试“成功”,但我没有得到关于报告的任何信息,并且方块仍然是空的。
关于如何解决它的任何想法?
【问题讨论】:
-
你解决了吗?我也遇到同样的问题
-
对不起.. XCode 更新后它消失了
-
我遇到了类似的问题:无法运行测试,没有报告任何内容,简短的平视显示器显示测试失败。重启设备修复它。
标签: unit-testing xcode7 xctest