Using the Code Coverage Viewer to view reports

Code Coverage for Ada, C and C++

The Code Coverage Viewer allows you to view code coverage reports generated by the Code Coverage feature. Select a tab at the top of the Code Coverage Viewer window to select the type of report:

  • A Source Report, showing the source code under analysis, highlighted with the actual coverage information.

  • A Rates Report, providing detailed coverage rates for each activated coverage type.

You can use the Report Explorer to navigate through the report. Click a source code component in the Report Explorer to go to the corresponding line in the Report Viewer.

You can jump directly to the next or previous Failed test in the report by using the Next Failed Test or Previous Failed Test buttons from the Code Coverage toolbar.

You can jump directly to the next or previous Uncovered line in the Source report by using the Next Uncovered Line or Previous Uncovered Line buttons in the Code Coverage feature bar.

When viewing a Source coverage report, the Code Coverage Viewer provides several additional viewing features for refined code coverage analysis.

To open a Code Coverage report, follow these steps:

  1. Right-click a previously executed test or application node
  2. If a Code Coverage report was generated during execution of the node, select View Report and then Code Coverage.

Coverage types

Depending on the language selected, the Code Coverage feature offers (see Coverage Types for more information):

  • Function or Method code coverage: select between function Entries, Entries and exits, or None.

  • Call code coverage: select Yes or No to toggle call coverage for Ada and C.

  • Block code coverage: select the desired block coverage method.

  • Condition code coverage: select condition coverage for Ada and C.

Please refer to the related topics for details on using each coverage type with each language.

Any of the Code Coverage types selected for instrumentation can be filtered out in the Code Coverage report stage if necessary.

To filter coverage types from the report, proceed as follows:

  1. From the Code Coverage menu, select Code Coverage Type.
  2. Toggle each coverage type in the menu.

For example, to filter out multiple conditions (MC) from the report, select Code Coverage > Code Coverage Type, and clear Multiple conditions.

Alternatively, you can filter out coverage types from the Code Coverage toolbar by toggling the Code Coverage type filter buttons.

Test by test analysis mode

The t est by test analysis mode allows you to refine the coverage analysis by individually selecting the various tests that were generated during executions of the test or application node. In Test-by-Test mode, a Tests node is available in the Report Explorer.

When test by test analysis is disabled, the Code Coverage Viewer displays all traces as one global test.

To toggle Test-by-Test mode, follow these steps:

  1. In the Code Coverage Viewer window, select the Source tab.
  2. From the Code Coverage menu, select Test-by-Test.

To select the Tests to display in Test-by-Test mode, follow these steps:

  1. Expand the Tests node at the top of the Report Explorer.
  2. Select one or several tests. The Code Coverage Viewer provides code coverage information for the selected tests.

Reloading a report

If a Code Coverage report has been updated since the moment you have opened it in the Code Coverage Viewer, you can use the Reload command to refresh the display:

To reload a report, select Reload from the Code Coverage menu, select Reload.

Resetting a report

When you run a test or application node several times, the Code Coverage results are appended to the existing report. The Reset command clears previous Code Coverage results and starts a new report.

To reset a report, select Reset from the Code Coverage menu.