XCode 5 unit testing: starts my app

前端 未结 7 1765
挽巷
挽巷 2020-11-29 23:04

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 i

7条回答
  •  [愿得一人]
    2020-11-29 23:38

    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. go to build settings for your unit test target
    2. search Bundle
    3. remove Bundle Loader and Test Host

    enter image description here

提交回复
热议问题