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.
Configuring a Scheme to Run Unit Tests
A scheme’s Test action identifies the unit-test targets the scheme uses to run unit tests. In the Test action, you specify which unit-test targets, test suites, and test cases you want the scheme to run.
If Xcode autocreates schemes for you after you add a unit-test target to your project, Xcode creates a scheme configured to run the unit tests in that target. You can also modify other schemes or add new schemes to run your unit tests.
Adding a Unit-Test Target to a Scheme
Before you can add a unit-test target to a scheme, ensure your project if properly configured for unit-testing. See Setting Up Unit-Testing in a Project to learn how.
To add a unit-test target to a scheme:
From the Scheme toolbar menu, choose the scheme to which you want to add the unit-test target.
From the same menu, choose Edit Scheme.
Select the Test action.
In the Test action Info pane, click the Add button.
Select the unit-test target you want to add to the Test action, and click Add.
Creating a Scheme that Runs Unit Tests
To create a scheme that runs the unit tests implemented in a unit-test target:
From the Scheme toolbar menu, choose New Scheme.
Specify the following information:
Target: Choose the unit-test target you want the scheme to use.
Name: Enter a name for the scheme.
Click OK.
Copyright © 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-09-18