AppCode 2019.3 Help

Catch2

Catch2 is a cross-platform testing framework. AppCode supports Catch versions 1.7.2 and later. With dedicated Catch run/debug configurations, you can specify test names with wildcards or tags and then explore the results in the test runner window.

Catch run/debug configuration

  1. To create a Catch configuration, go to Run | Edit Configurations, click icons general add and select Catch from the list of templates.

  2. Specify the configuration settings:

    • Set the configuration name in the Name field. This name will be shown in the list of the available run/debug configurations.

    • Select the Tags/Test option to run a test for the particular tags or all the tags. Select the Pattern option to run all the tests for a particular pattern.

    • Specify tags in the tags fields. This option is available only when the Tags/Test option is selected.

    • Select the desired test from the Test drop down list. Note, that this option is available only when one or more tags have been provided.

    • Specify the pattern name in the Pattern field. Note, that this option is available only when the Pattern option is selected.

    • In the Target field, select the desired target from the list of available targets.

  3. Save the configuration, and it's ready for Runicons actions execute or Debugicons actions startDebugger.

Running tests

In AppCode, there are several ways to start a run/debug session for tests, one of which is using special gutter icons. These icons help quickly run or debug a single test or a whole suite/fixture:

gutter icons for tests

Gutter icons also show test results (when already available): success icons runConfigurations testState green2 or failure icons runConfigurations testState red2.

When you run a test/suite/fixture using gutter icons, AppCode creates a temporary Catch configuration, which is greyed out in the configurations list. To save a temporary configuration, select it in the Edit Configurations dialog and press icons actions menu saveall:

saving temporary test configuration

Last modified: 6 February 2020