AppCode 2018.1 Help

Boost Test Support

Boost.Test is one of the most popular testing frameworks for C++ development. Boost.Test support in AppCode includes:

  • Special Boost.Test Run/Debug configurations

  • Built-in test runner with the progress bar and a tree view of all the tests running

  • Ability to re-run failed tests, export test results, open previously saved results

  • Ability to navigate to the source code of a particular test

Getting started with Boost.Test

To use the Boost.Test framework in your projects, do the following:

  1. Add Boost.Test to your project. You can add headers to your project and point to the include directories:

    ac boostTestInclude

  2. Now you can run your tests:

    ac runBoost
    and observe results in the Run tool window:
    ac boostTestsResults

Creating a Boost.Test Run/Debug configuration

Though you can simply run the Boost.Test target from your project as an ordinary configuration in AppCode, to take advantage of the built-in test runner, create specific Boost.Test configuration (one or more). For every target it can be done automatically when you run a test/set of tests, or explicitly.

Important note: AppCode supports Boost.Test version from 1.55 and higher, but if you are using the version lower than 1.62 you can find the "Test framework quit unexpectedly" warning message in the Run tool window, instead of expected test result tree view. In this case you need to specify the following string in the Program arguments field of Run/Debug configurations dialog:

--log_format=HRF --log_level=all

To create a Boost.Test run/debug configuration automatically, do one of the following:
  • In the editor, place caret on any line of a test code and run the test from the context menu or by pressing N/A. AppCode creates the related run/debug configuration automatically, as in example:

    ac boostTest Any
    You can rerun it later, when needed.

  • In the project view, select a test source file (you can also place the caret in that file code in the editor or on a suite name). In the context menu, select Run All in ... or press N/A to run the test. AppCode automatically creates and saves the following configuration, which you can reuse later:

    ac boostTest All

To create the Boost.Test run/debug configuration manually, do the following:

  • In the main menu, select Run | Edit Configurations. In the dialog that opens:
    1. Click add.png on the toolbar or press N/A. Select Boost.Test from the list.

    2. For the new Boost.Test run/debug configuration:
      • Specify its name in the Name text box. This name will be shown in the list of the available run/debug configurations.

      • Select the Suite/Test radio button to run a particular or all the tests of a suite. Select Pattern radio button to run all the tests of a particular pattern.

      • Specify the suite name in the suite text box. Note, that this option is available only when the Suite/Test radio button is selected.

      • Select the desired test from the Test drop down list. Note, that this option is available only when the Suite/Test radio button is selected.

      • Specify the pattern name in the Pattern text box. Note, that this option is available only when the Pattern radio button is selected.

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

      • Specify common run/debug configuration parameters.

      • Apply the changes and close the dialog box.

      ac BoostTest New

To update an existing configuration:
In the main menu, select Run | Edit Configurations. In the dialog that opens:

  • Expand the Boost.Test node and select the desired configuration.

  • Update the required fields and apply changes.

Last modified: 19 September 2019