Run tests
Run the selected test or test folder:
Stop the current test session:
To run all the tests in your Cargo project, do one of the following:
On the main toolbar, select the Test [project_name] configuration in the switcher and click
.
tip
The Test [project_name] configuration is created automatically when you open a project for the first time. It runs the
cargo test --workspace
command. You can edit this configuration like any other in Run | Edit Configurations.Press twice to invoke the Run Anything popup. Type the
cargo test --workspace
command and press .Open the Cargo tool window (View | Tool Windows | Cargo). Click the
button, type
test --workspace
, and press .
If your tests don't require any specific actions before start, and you don't want to configure additional options, such as code coverage, you can run them by using the following options:
Place the caret at the test file to run all tests in that file, or at the test method, and press . Alternatively, click the
gutter icon next to the test method and select Run '<test name>' from the list.
Press twice to open the Run Anything popup and specify the
cargo test
command with additional arguments if required.Double-click the test target in the Cargo tool window (View | Tool Windows | Cargo).
To run all tests in a folder, select this folder in the Project tool window and press or select Run Tests in 'folder' from the context menu.
When you run a test, RustRover creates a temporary run configuration. You can save temporary run configurations, change their settings, share them with other members of your team. For more information, refer to Run/debug configurations.
Use the Run widget on the main toolbar to select the configuration you want to run.
Click
or press .
Open the Run/Debug Configuration dialog by doing one of the following:
From the configuration switcher on the main toolbar, select Run | Edit Configurations.
Go to Run | Edit Configurations.
Press and select Edit Configuration from the context menu.
Click
on the toolbar and select Cargo.
Name your configuration (or leave the default name).
In the Command field, type the Cargo command:
test
+ extra arguments if needed.Click Apply and close the Run/Debug Configurations dialog.
After RustRover 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.

The console on the right shows the output of the current test session. The test results toolbar located above the list of test results provides you with several helpful options.

Use the following options on the test results toolbar of the tab for the run configuration:
Click
or press to terminate the process immediately.
Click
to terminate the process gracefully, allowing shutdown hooks to run.

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

Click
on the test results toolbar or press to rerun all tests in a session.

In RustRover, you can enable the autotest-like runner: any test in the current run configuration restarts automatically after you change the related source code.
Click
Rerun Automatically on the test results toolbar to enable the autotest-like runner.
To start running or debugging a test, you can use the main toolbar or a context menu in the Project tool window or in the editor:
Use the main toolbar:
Select the necessary run/debug configuration from the list on the main toolbar.
Press to see the list of available run configurations or for debug configurations.
Click Run
or Debug
to the right of the list. Alternatively, select Run | Run or Run | Debug from the main menu.
Use a context menu:
Right-click a test class in the Project tool window or open it in the editor, and right-click the background. From the context menu, select Run <class name> 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>.