Filtering code coverage results during collection

You can use filters to include or exclude modules, parts or compile units, and files during code coverage collection.

Filtering code coverage results during collection is supported with an Eclipse IDE and in headless mode.

Filtering results during collection with an Eclipse IDE

To filter results during code coverage collection, specify a filter list file that contains valid code coverage filters.
  1. From the main toolbar, click the down arrow to the right of the Compiled Code Coverage icon (Compiled Code coverage icon) and select Compiled Code Coverage Configurations. The Compiled Code Coverage Configurations wizard opens.
  2. Select or create a launch configuration for z/OS Batch Application using existing JCL or z/OS UNIX applications.
  3. On the Code Coverage tab, select Filter list file to enable this option.
  4. Specify a filter list file. You can enter the file path directly, or click Browse to select a file. Only .txt files are supported.
  5. To update filters in this file, click Edit. The Edit Code Coverage Filters window opens. The filters retrieved from the file are displayed in the window. You can use this window to add, edit, remove, or reorder the code coverage filters.
Note:
  • z/OS Batch Application using a property group launch configurations do not support adding filters for code coverage collection.

Filtering results during collection in headless mode

When you run code coverage in headless mode, you can specify -R,filter=<filters> or -r,filterlist=<path> to filter code coverage results during collection.
-R,filter=<filters>
Specifies a list of filters that are enclosed in single or double quotation marks. Use commas to separate the filters. The filters allow strings or regular expressions to include or exclude modules, parts, and files.
-r,filterlist=<path>
Specifies a file that contains a list of filters to include or exclude module, parts, and files. Each filter appears on a separate line.

For more information on how to specify the filters, see Code coverage filters.

Notes:
  • Headless code coverage is not available on macOS.
  • If multiple filters match the same module, part, or file, the last filter in the R,filter=<filters> or the file specified in -r,filterlist=<path> is used.
  • Messages are included in the results to indicate which items were excluded. The messages are displayed when you open the results in the client.
  • If an invalid regular expression is specified in a filter, the headless code coverage collector will not start.
  • If no result is available with the specified filters, a message appears indicating that no result is created.