OCUnit测试未运行/未找到 [英] OCUnit tests not running / not being found

查看:161
本文介绍了OCUnit测试未运行/未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图掌握OCTest,但似乎无法使其真正运行我的测试(至少,我认为它没有运行我的测试).我已经按照

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");
}

当我构建测试包(在Debug或Release中)时,"Build Results"面板会简短地显示它正在运行单元测试(它说类似正在为...(GC OFF)运行单元测试"),然后显示Build Succeeded消息.当我进行较少的琐碎测试时,也会发生同样的情况:

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?

推荐答案

  1. 将项目目标设置为ocunit吗?
  2. 在您的m文件的信息中,它是否定位到OCUnit?

这篇关于OCUnit测试未运行/未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆