Retired Document
Important: This version of Unit Testing Guide has been retired. The replacement document focuses on the new testing features and workflow provided by Xcode 5 and later revisions. For information covering the same subject area as this page, please see Testing with Xcode.
Running Unit Tests
To ensure that changes you make to your code don’t alter its correct behavior, you should run your test suites periodically, especially after making significant changes. This chapter explains how to run unit tests.
You run unit tests by executing the Test command on a scheme whose Test action identifies one or more unit-test targets.
To run unit tests:
From the Scheme toolbar menu, choose the scheme that incorporates the unit-test targets you want to use in its Test action (see Configuring a Scheme to Run Unit Tests), and the run destination.
Choose Product > Test.
If one or more tests cases fail, they are listed in the issue navigator (View > Navigators > Show Issue Navigator).
To view the transcript of your unit-test run, choose View > Navigators > Show Log Navigator, and select the first test action listed in the log navigator.
The log viewer shows the log of the unit-test run, as shown in Figure 5-1.
Copyright © 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-09-18