Associated views

The QNX Code Coverage perspective includes the following views:

Code Coverage Sessions view

The Code Coverage Sessions view lets you control and display multiple code-coverage sessions:

Screen showing a code coverage session in the Code Coverage Sessions view.

The view shows the following as a hierarchical tree for each session:

Session item Description Possible icons
Code coverage session Launch configuration name, coverage tool, and start time (e.g. ccov102_factor [GCC Code Coverage] (7/2/03 2:48 PM))

The Inactive session icon

The Remove analysis icon

Project Project name and amount of coverage (e.g. ccov102_factor [ 86.67% ])

The Project icon

File Filename and amount of coverage (e.g. ccov102_factor.c [ 86.67% ])

The C file icon

Function Function name and amount of coverage (e.g. main [ 100% ])

The Function icon

The IDE uses several icons in this view:

Icon Icon Color Meaning

The Has no coverage icon

White No coverage

The Has some coverage icon

Yellow Partial coverage

The Has 100% coverage icon

Green Full (100%) coverage

The Out-of-Sync file icon

(cell is highlighted) Out-of-date source file
x Red An error marker to indicate some type of error (e.g. a code coverage data file was not found, or an error reading data or notes files).

The IDE also adds a coverage markup icon (The Has coverage marker icon) to indicate source markup in the editor. (See the Examine data line-by-line section, below.)

To reduce the size of the hierarchical tree, you can click the Collapse All ( The Collapse All icon) button.

Combine Code Coverage sessions

To combine several sessions:
  1. In the Code Coverage Sessions view, select the sessions you want to combine.
  2. Right-click your selections and select Combine/Copy Sessions. The IDE prompts you for a session name and creates a combined session.

Examine data line-by-line

The IDE can show the line-by-line coverage information for your source code. In the Figure below, the left margin of the editor shows a summary of the coverage (whereas the right margin shows color-coded bars), by showing green check marks for fully covered code, a red cross for each line not covered, and a yellow ball icon for each partially covered or a block of collapsed code.

Screen showing the Code Coverage Editor view.

Opening a file in the Code Coverage perspective

To open a file in the QNX Code Coverage perspective:

  1. In the Code Coverage Sessions view, expand a session and double-click a file or function.

Code coverage markers are added to the left pane of the opened file.

Showing coverage information for a specific session

To show coverage information from a particular session:

  1. In the Code Coverage Sessions view, select a session. The IDE shows all of the various markers.

Showing coverage information when opening a file

To automatically show coverage information when opening a file:

  1. Open the Preferences dialog (Window > Preferences).
  2. In the left pane, select QNX > Code Coverage.
  3. In the right pane, check the desired markers in the Coverage markup when file is opened field.
  4. Click OK. The next time you open a file, the markers appear automatically. To add markers from another session, add them manually, as described above.

Removing coverage markers

To remove all coverage markers:

  1. In the Code Coverage Sessions view's title bar, click the Remove All Coverage Markers button (The Remove All Coverage Markers icon).

Code Coverage Properties view

The Properties view shows a summary of the code coverage for a project, file, or function you've selected in the Code Coverage Sessions view.

The Properties view tells you how many lines were covered, not covered, and so on:

Screen showing the summary of the code coverage results for a selected project in the Properties view.

Code Coverage Report view

The Code Coverage Report view provides a summary (in XML) of your session. The view lets you drill down into your project and see the coverage for individual files and functions:

Screen showing the Code Coverage Report view summary.

Generating a report

To generate a report, simply right-click a coverage session and select Generate Report.

By default, the IDE shows reports in the Code Coverage Report view, but you can also have the IDE show reports in an external browser. Using an external browser lets you compare several reports simultaneously.

Changing views

To toggle between viewing reports in the Code Coverage Report view and in an external browser:

  1. Open the Preferences dialog (Window > Preferences).
  2. In the left pane, select General > Web Browser.
  3. In the right pane, enable or disable the Use external Web browser check box.
  4. Click OK.

Saving a report

To save a report:

  1. Right-click in the Code Coverage Report view to show the context menu.
  2. Click Save As... to save the report.

Refreshing a report

To refresh a report:

  1. In the Code Coverage Report view's title bar, click the Refresh button (The Refresh icon).

Printing a report

To print a report:

  1. In the Code Coverage Report view's title bar, click the Print button (The Print icon).

Setting report options

By default, the report generated by the IDE doesn't include the code coverage information from other included files; however, you can choose to view this information, if desired.

  1. Select Window > Preferences.
  2. In the left pane, expand QNX and select Code Coverage.
  3. In the right pane, select Show code coverage information from included files.
  4. Click OK.

Last modified: 2013-12-21

comments powered by Disqus