AppCode 2019.3 Help

Create run/debug configurations for tests

You can run your tests using run/debug configurations, in the way similar to running ordinary applications.

In addition to the regular test configuration creation, AppCode supports creating test configurations for specific targets, for example for all tests in a file, class, or directory, or for an arbitrary selection of test classes and methods.

Create a test configuration

  1. From the main menu, choose Run | Edit Configurations.

  2. Click Add New Configuration on the toolbar and select one of the available testing frameworks: Boost.Test, Catch, Google Test, or XCTest.
    Add a run/debug configuration for tests
  3. In the dialog that opens, you can change the following configurations:
    • In the Name field, chanage the name of the run/debug configuration. The default name includes the selected class/method and test target.

    • Select the test kind.

      Depending on the framework, the following test kinds are available:

      • XCTest: class/method or pattern.

      • Boost.Test and Google Test: suite/test or pattern.

      • Catch: tags/test or pattern.

    • If you need a particular test class or method to be selected, in the Class field, enter the test class name. AppCode will suggest you available classes as you type. When a class is selected, you can start typing the name of the method of this class in the Method field and choose one of the suggested variants.

      If no methods/classes are specified, AppCode will run all available classes/methods.

    • In the Target field, your test target is preselected. Change it if necessary.

    • In the Configuration field, you can select the configuration type — debug or release.

    • If necessary, specify working directory and add program arguments and environment variables in the corresponding fields.

    • In the Before run section, you can define whether you want to launch any external tool or another run/debug configuration before run.

Create a test configuration for a specific file

  1. In the Project tool window, right-click the desired file with test classes, and select Create 'All in <filename>'.

  2. In the Run/Debug Configuration dialog that opens, specify the configuration parameters and activities to perform before test execution. Apply the changes and close the dialog.

Create a test configuration for a specific class or method

  1. In the editor, open the file containing test classes.

  2. Right-click the class or method name and select Create 'All in <class name>'.

  3. In the Run/Debug Configuration dialog that opens, specify the configuration parameters and activities to perform before test execution. Apply the changes and close the dialog.

Last modified: 4 December 2019