JetBrains Rider 2021.2 Help

Coverage results filters

JetBrains Rider applies these filters to coverage results after a coverage session is over. Use these filters to:

Exclude a node (namespace, class, class member) from coverage results

  1. Open the Unit Tests Coverage window.

  2. Select a node and in the context menu choose:

    • Exclude from Coverage Results to exclude the node from the current results.

    • Exclude and Create Runtime Coverage Filter to exclude the node from the results and create a corresponding runtime filter that will prevent collecting coverage data for this node in future coverage sessions.

    • Exclude All But This to leave only the selected node in the coverage tree.

    JetBrains Rider: Exclude and create coverage filter

Show the excluded nodes back

Exclude a file from coverage results

  1. In Rider settings, open Build, Execution, Deployment | dotCover | Filtering.

  2. Find the Exclude file masks list.

  3. Click Add filter to add a new exclude filter for specific file masks.

    You can use Ant-style wildcards in file masks:

    • ? to match a single character excluding directory separators

    • * to match zero or more characters excluding directory separators

    • ** to match any number of characters including directory separators

    • / or \ to match directory separators regardless of the OS path format

    For example a pattern **Test?\**.* will match the following files:

    • C:\Projects\MyTestX\data\file_one.txt

    • /home/projects/TestY/file_two.xml

    Bun not:

    • C:\Projects\Test\data\file_one.txt

    • /home/projects/TestY/file_two

Last modified: 16 November 2021