Analyze Coverage of Unity Tests
JetBrains Rider comes with bundled coverage analysis tool based on JetBrains dotCover. For more details on coverage analysis, refer to Coverage analysis of .NET code.
Installation and licensing
dotCover is provided as a bundled plugin for Rider, and installed along with Rider automatically with no additional actions needed. If you want to disable dotCover, you can do this via Rider's Plugins settings.
dotCover is only available in Rider for the owners of dotUltimate or All Products Pack subscriptions.
Important notes
To run coverage analysis, your Unity project must have the 'Rider Editor' and 'Test Framework' packages. Version requirements:
Unity
Rider Editor
Test Framework
2018.3 – 2019.1
any
any
2019.2 and later
1.2.0 or later
any
Earlier than 1.2.0
1.1.1 – 1.1.3
To run coverage analysis, Unity Editor must be started in the special mode with enabled coverage support.
Only edit-mode tests are supported.
How to analyze coverage of Unity tests
Open your Unity solution in Rider.
On the Unity toolbar, choose Start Unity with Coverage:
This will run Unity Editor with enabled coverage support (your Unity project will be opened automatically).
Work with Unity tests as you work with regular unit tests. For example, to run tests coverage analysis, open the Unit Tests window, select the desired tests, and click the Cover Selected Unit Tests button.