Running Tests

Run unit tests to exercise test cases and assess the quality of your app.

bullet
To run tests
  1. In the test navigator, select the test methods to run.

    To run all tests in the active scheme, choose Product > Test.

  2. Choose Product > Perform Action > Run Test Methods to run the selected tests.

    A summary of the test results appears briefly onscreen and the test icons are updated to reflect any status changes to the tests.

    If a test succeeded, a test indicator icon denoting success (a green diamond with a checkmark) appears to the right of the test name. If a test failed, a test indicator icon denoting failure (a red diamond with an x) appears to the right of the test name, and the issue is displayed in the issue navigator.

    ../Art/run_tests_issues_2x.png
  3. To rerun a failed test after addressing the issue, click the failed-test test indicator in the gutter, or choose Product > Perform Action > Test Again.

To run an individual test, click the arrow to the right of the test method name.

To configure how Xcode behaves when running tests, use the Behaviors pane in the Preferences dialog.

Related Articles