Speed up tests indexing
Test indexing is one of the most CPU- and time-consuming IDE procedures. To speed it up, you can use CLion's mechanism of detecting test scopes or create a test scope manually. Either way, after you have a test scope, only the files filtered by this scope will be processed during test indexation.
Automatic test scope detection
CLion can identify test files in your project and create a test scope automatically.
Select Create test scope:
(Ctrl+Shift+A) from the main menu and search forCLion shows the result of test detection in a balloon:
Click View changes to open the viewer, where you can check the current pattern (if it was detected previously or configured manually) and the new one:
Click Apply new Test Scope. In the Scopes dialog that opens, you can check and adjust the automatically detected pattern:
Click Apply to save the changes.
CLion also opens the test scope creation report in the editor:
Create a Tests scope manually
Go to
.Click the Add Scope button () and select what kind of scope you want to define: local or shared.
Set the following name for the new scope: Tests.
You can configure another name in
:Specify the file- or folder-based pattern for the scope. CLion will highlight the matching files in the project tree pane:
Click Apply to save the Tests scope. From this point on, only the files defined by this scope will be indexed during the Indexing tests phase.
You can use the Tests scope to filter the Project view and quickly access the test files in your project: