在Xcode 4.5中向项目添加逻辑测试 [英] Adding Logic Tests to the project in Xcode 4.5

查看:34
本文介绍了在Xcode 4.5中向项目添加逻辑测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用xcode 4.5并尝试向项目中添加逻辑测试.(这实际上是一个测试,新创建的项目,没有单元测试).我正在遵循此指南: http://developer.apple.com/library/mac/#documentation/developertools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html 所以,到目前为止我做的是:

I'm using xcode 4.5 and trying to add logic tests to the project. (This is actually a test, newly created project without unit tests). I'm following this guide: http://developer.apple.com/library/mac/#documentation/developertools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html So, what i've done so far:

  1. 创建了一个新项目(基于视图的应用程序模板)
  2. 单击文件-> New- CocoaTouchUnitTestBundle就是这样.这些测试(作为文档说明)可以使用.但是我有以下问题:SenTestinKit.framework以红色显示

如果我按测试"按钮,问题导航器将不显示任何内容:

If I press Test button issue navigator shows nothing:

如果我在此处选择其他调试器(默认情况下为LLDB,尝试选择GDB):

If I select another debugger here(LLDB by default, trying to select GDB):

Xcode只是挂出:

Xcode just hangs out:

P.S我还试图删除SenTestingKit.framework(红色)并添加新的.什么都没改变.

P.S I also tried to remove SenTestingKit.framework (which is in red) and add new. Nothing changed.

我做错了什么?我想看到这样的东西(苹果指南的截图):

What am I doing wrong ?? I suppose to see something like this(screenshot from apple guide):

任何帮助都会得到极大的帮助!

Any help will be greatly appriciated!

推荐答案

实际上,您的代码现在可以使用了.

Actually, your code works now.

我不知道为什么在创建测试包时,Xcode最初没有正确添加SenTestingKit框架.

I don't know why Xcode didn't initially add the SenTestingKit framework in correctly when you created the test bundle.

但是现在为您自动生成的代码"testExample"正在运行,它告诉您通过给您一个错误来添加一些真实的测试.这就是STFail所做的.

But now the code, "testExample" which was auto-generated for you, is running, and it is telling you to add in some real tests, by giving you an error. That's what STFail does.

因此,如果您删除该行,并开始编写自己的测试,那应该没事.

So, if you take out that line, and start writing your own tests, you should be fine.

这篇关于在Xcode 4.5中向项目添加逻辑测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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