Code Coverage Sessions View

Control and display multiple code coverage sessions

Description:

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

Code Coverage Sessions view

The view displays 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)) Icon: Inactive session Icon: Remove analysis
Project Project name and amount of coverage (e.g. ccov102_factor [ 86.67% ]) Icon: Project
File Filename and amount of coverage (e.g. ccov102_factor.c [ 86.67% ]) Icon: C file
Function Function name and amount of coverage (e.g. main [ 100% ]) Icon: Function

The IDE uses several icons in this view:

Icon Meaning
Icon: Has no coverage No coverage
Icon: Has some coverage Partial coverage
Icon: Has 100% coverage Full (100%) coverage
Icon: Out-of-Sync file Missing or out-of-date source file

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

To reduce the size of the hierarchical tree, click the Collapse All (Icon: Collapse All) button.

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.

Examining data line-by-line

The IDE can display the line-by-line coverage information for your source code. In the left margin, the editor displays a "covered" icon (Icon: Executed line marker) beside each line of source. In the right margin, the editor displays a summary of the coverage by showing green sections for fully-covered code, yellow for partial coverage, and red for no coverage:

Editor; C/C++, showing code coverage

To open a file in the QNX Code Coverage perspective: In the Code Coverage Sessions view, expand a session and double-click a file or function. To display coverage information from a particular session: In the Code Coverage Sessions view, right-click a session and select Coverage Markup, then select one of the following:

The selected icon appears beside the corresponding source in the C/C++ editor. In the Code Coverage Sessions view, a coverage marker (Icon: Has coverage marker) overlays the source file icon.

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.
To remove all coverage markers: In the Code Coverage Sessions view's title bar, click the Remove All Coverage Markers button (Icon: Remove All Coverage Markers).