Run and debug tests
Generally, AppCode runs and debugs tests in the same way as other applications, by running the run/debug configurations you have created. When doing so, it passes the specified test classes or methods to the test runner.
Run or debug a test
Use the ⌃⇧R and ⌃⇧D shortcuts:
Place the caret at the test class or method that you want to run or debug.
Press ⌃⇧R/⌃⇧D to run/debug the selected class or method.
AppCode will run/debug the selected class or method using the automatically created temporary run/debug configuration.
Use the main toolbar:
Select the necessary run/debug configuration from the list on the main toolbar.
Press ⌃⌥R to see the list of available run configurations or ⌃⌥D for debug configurations.
Click Run or Debug to the right of the list. Alternatively, press ⌃R/⌃D to run/debug the selected configuration.
Use a context menu:
Right-click a test file in the Project tool window or open it in the editor, and right-click the background. From the context menu, select Run... or Debug....
For a test method, open the class in the editor and right click anywhere in the method. The context menu suggests the command Run / Debug <method name>.
Use gutter icons:
Click icon to run a single test, or icon to run all tests from the suite (fixture, in case of Google Test):
You can repeat your test session, or individual tests without leaving your test runner tab of the Run tool window. The tests are performed again using the same run configuration as in the initial run.
Rerun a testing session
Press ⌘R or click on the toolbar of the Test Runner tab.
Rerun an individual test
In the Test Runner tab, click a test case node or a test and select on its context menu.
Rerun failed tests
In the Test Runner tab, click on the toolbar.
Debug a failed test
In the Test Runner tab, press ⇧ and click Rerun Failed Tests .
Select Debug from the Restart Failed Tests popup.
The tests that have failed will rerun in the debug mode.
You can abort a test session at any point, and all the tests that are currently running will stop immediately.
To stop a test session, click the stop button on the toolbar of the test runner, or press ⌘F2.