Coverage source report

Code Coverage for Ada, C and C++

You can use the standards keys (arrow keys, home, end, etc.) to move about and to select the source code. The Code Coverage source report displays covered and uncovered lines of code colors. You can change these colors in the Code Coverage report preferences.

Note   In C source files, the last bracket '}' in a function after a return statement is always displayed as uncovered in the coverage report, even if the function reports 100% coverage.

Hypertext Links

The Source report provides hypertext navigation throughout the source code:

Macro Expansion

Certain macro-calls are preceded with a magnifying glass icon.

Click the magnifying glass icon to expand the macro in a pop-up window with the usual Code Coverage color codes.

Hit Count

The Hit Count tool-tip is a special capability that displays the number of times that a selected branch was covered.

Hit Count is only available when Test-by-Test analysis is disabled and when the Hit Count option has been enabled for the selected Configuration.

To activate the Hit Count tool-tip:

  1. In the Code Coverage Viewer window, select the Source tab.

  2. From the Code Coverage menu select Hit. The mouse cursor changes shape.

  3. In the Code Coverage Viewer window, click a portion of covered source code to display the Hit Count tool-tip.

Cross Reference

The Cross Reference tool-tip displays the name of tests that executed a selected branch.

Cross Reference is only available in Test-by-Test mode.

To activate the Cross Reference tool-tip:

  1. In the Code Coverage Viewer window, select the Source tab.

  2. From the Code Coverage menu select Cross Reference. The mouse cursor changes shape.

  3. In the Code Coverage Viewer window, click a portion of covered source code to display the Cross Reference tooltip.

Comment

You can add a short comment to the generated Code Coverage report by using the Comment option in the Misc. Options Settings for Code Coverage. This can be useful to distinguish different reports generated with different Configurations.

Comments are displayed as a magnifying glass symbol at the top of the source code report. Click the magnifying glass icon to display the comment.

Related Topics

About the code coverage viewerCoverage rates reportSelecting coverage types