OCUnit 测试未运行/未找到
我正在尝试掌握 OCTest,但似乎无法让它实际运行我的测试(至少,我相信它没有运行我的测试)。我已经按照 开发人员文档,并添加了一个名为 UnitTests 的类,其中包含以下功能:
-(void)testFailures
{
STFail(@"A message");
}
当我构建测试包(在调试或发布中)时,“构建结果”面板会简要显示它正在运行单元测试(它说类似“正在运行单元测试...(GC OFF)”),但随后显示“构建成功”消息。当我进行一些不那么琐碎的测试时,也会发生同样的情况,例如:
- (void)testFramework
{
NSString *string1 = @"test";
NSString *string2 = @"testing";
STAssertEquals(string1,
string2,
@"FAILURE");
}
关于我哪里出错了有什么想法吗?
I'm trying to get to grips with OCTest, but can't seem to get it to actually run my tests (at least, I believe it's not running my tests). I've set up a project as described in the developer documentation, and added a class called UnitTests which contains the following function:
-(void)testFailures
{
STFail(@"A message");
}
When I build the test bundle (in Debug or Release), the Build Results panel shows briefly that it's running the unit tests (it says something like 'Running unit tests for ... (GC OFF)'), but then shows the Build Succeeded message. The same occurs when I put less trivial tests in, such as:
- (void)testFramework
{
NSString *string1 = @"test";
NSString *string2 = @"testing";
STAssertEquals(string1,
string2,
@"FAILURE");
}
Any ideas as to where I'm going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是更新了有关单元测试的 Apple 文档链接。
Here is an Updated Link to the Apple Docs on unit testing.