CLion 2026.2 Help

Run, debug, terminate tests

Run tests directly in a file or folder

If your tests do not require any specific actions before start, and you do not want to configure additional options, such as code coverage, you can run them by using the following options:

  • Click the gutter icon next to the test or test suite/fixture.

    The gutter icon changes depending on the state of your test:

    • The gutter icon marks a set of tests.

    • The gutter icon marks new tests.

    • The gutter icon marks successful tests.

    • The gutter icon marks failed tests.

    Running a test using the gutter icon

Run tests using the Run widget

  1. Create a new test configuration or save a temporary one.

  2. Use the Run widget on the main toolbar to select the configuration you want to run.

  3. Click or press Shift+F10.

    Test configurations switcher

Run tests from the Commit tool window

If you made changes to your test classes and want to run them before committing, you can do it from the Commit tool window. You can choose whether to run a single test class, multiple classes, or all uncommitted test classes under a directory, module, or changelist.

  1. Go to the Commit tool window (Alt+0).

  2. Right-click a test class, directory, module, or changelist, and select Run icon Run '<Test Class Name>'.

    Run action in the context menu of the Commit tool window

As a result, CLion creates and launches a temporary run configuration for your test selection. If you want to rerun the same tests in the future, you can save this configuration in the run widget and then customize its settings.

After CLion finishes running your tests, it shows the results in the Run tool window on the tab for that run configuration. For more information about analyzing test results, refer to Explore test results.

Stop tests

Use the following options on the Run toolbar of the tab for the run configuration:

  • Click the Stop button or press Ctrl+F2 to terminate the process immediately.

Rerun tests

Rerun a single test

  • Right-click a test on the tab for the run configuration in the Run tool window and select Run 'test name'.

    Rerunning a test

Rerun all tests in a session

  • Click the Rerun button on the Run toolbar or press Ctrl+F5 to rerun all tests in a session.

Rerun failed tests

  • Click the Rerun Failed Tests icon on the Run toolbar to rerun only failed tests.

    Hold Shift and click to choose whether you want to Run the failed tests again or Debug them.

    You can configure the IDE to trigger tests that were ignored or not started during the previous test run together with failed tests. Click the Settings button on the Run toolbar and enable the Include Non-Started Tests into Rerun Failed option.

Debug tests

  1. In the editor, click the gutter on the line where you want to set a breakpoint.

  2. Right-click the gutter icon next to the failed test and select Debug 'test name'.

    Debugging a failed test

    Alternatively, use the context menu of the test in the Test runner window:

    Test runner context menu

    The test will rerun in debug mode. After that, the test will be suspended, allowing you to examine its current state.

    You can step through the test to analyze its execution in detail.

01 July 2026