Test phase is grayed out in XCode 4

匆匆过客 提交于 2019-12-30 01:34:12

问题


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

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

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?


回答1:


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

  • Click the scheme selector
  • Click Edit scheme
  • Make sure the scheme you use for your actual application is selected
  • In the sidebar, you have "Build", "Run", "Test", etc. Click the "Test" entry.
  • In the table view, click the + at the bottom and select your test target, click add.

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




回答2:


You probably need to make sure that your active scheme is pointing at the right target (your test bundle).



来源:https://stackoverflow.com/questions/5384024/test-phase-is-grayed-out-in-xcode-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!