测试阶段在 XCode 4 中变灰 [英] Test phase is grayed out in XCode 4

查看:19
本文介绍了测试阶段在 XCode 4 中变灰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在我的项目中使用 GHUnit,因为 XCode 3 中的内置单元测试非常糟糕.

I've been using GHUnit in my project because the built in unit testing was so terrible in XCode 3.

然而,现在它们已经在 XCode 4 中得到修复,我想切换回官方测试框架.

However, now that they've been fixed in XCode 4, I want to switch back to the official testing framework.

我添加了一个新的Cocoa Touch Unit Testing Bundle",它也添加了一个设计为失败的测试用例,但是产品菜单下的测试"仍然是灰色的.

I added a new "Cocoa Touch Unit Testing Bundle", which also adds a test case designed to fail, but "Test" under the Product menu is still grayed out.

我还需要做什么才能在我的项目中运行单元测试?

What else do I need to do to get unit tests running in my project?

推荐答案

您需要为您的主要应用程序目标编辑方案.

You need to edit the scheme for your main application target.

  • 点击方案选择器
  • 点击编辑方案
  • 确保选择了用于实际应用程序的方案
  • 在侧边栏中,您有构建"、运行"、测试"等.点击测试"条目.
  • 在表格视图中,点击底部的 + 并选择您的测试目标,点击添加.

产品菜单中的测试"选项不再变灰.

The "Test" option in the product menu is no longer grayed out.

这篇关于测试阶段在 XCode 4 中变灰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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