XCode 5单元测试:启动我的应用 [英] XCode 5 unit testing: starts my app

查看:89
本文介绍了XCode 5单元测试:启动我的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在XCode 5中运行测试时,运行测试时,OS X应用程序的主窗口会在屏幕上显示几秒钟.为什么?即使我取消所有测试的注释,它仍然会打开我的主窗口.

When I run my tests in XCode 5, the main window of my OS X app appears on the screen for a couple of seconds while running the tests. Why? Even if I uncomment all my tests it still opens my main window.

推荐答案

您正在运行应用程序测试,而不是逻辑测试.这意味着将启动您的应用程序实例,然后运行单元测试.这使您可以执行一些要求您的应用程序正在运行的集成测试.

You are running application test, not logic test. This means an instance of your app will be started and then run the unit tests. This allow you to perform some integration test that require your app is running.

Here is the guide to setup application test and logic test.

如果要将其更改为逻辑测试(因此它运行速度更快,不需要首先启动您的应用程序):

If you want to change it to logic test (so it run faster and don't need to start your app first):

  1. 开始为单元测试目标建立设置
  2. 搜索Bundle
  3. 删除捆绑程序加载器和测试主机

这篇关于XCode 5单元测试:启动我的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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