Code Coverage Settings

The Code Coverage settings are part of the Runtime Analysis node of the Configuration Settings dialog box, which allows you to configure settings for each node.

By default, the settings of each node are inherited from those of the parent node. When you override the settings of a parent node, changes are propagated to all child nodes within the same Configuration. Overridden fields are displayed in bold.

Instrumentation control settings

You can use the Coverage Type settings to declare various types of coverage.

  • Coverage level functions : select between function Entries, With exits, or None.

  • Coverage Level Blocks: select the desired block code coverage type. Please see Selecting Coverage Types for details on using each coverage type with each language.

You can combine, enable, or disable any of these coverage types before running the application node. All coverage types selected for instrumentation can be filtered out in the Code Coverage Viewer.

  • Coverage level calls: select Yes or No to toggle call code coverage. For Ada and C only.

  • Coverage level conditions: select the condition level of code coverage to be included in the report. For Ada and C only:

    • None: The coverage report ignores conditons.

    • Basic: Only basic conditions are included in the coverage report.

    • Modified (MC/DC): Only modified conditions are included in the coverage section of the test report.

    • Modified and Multiple: Both modified and multiple conditions are included in the coverage report.

    • Forced Modified (MC/DC): The report includes modified conditions where all operators are replaced with bitwise operators.

    • Forced Modified and Multiple: The report includes modified and multiple conditions where all operators are replaced with bitwise operators.

See Condition coverage (C), Condition coverage (Ada), and Bitwise MC/DC coverage for more information about coverage levels.

  • Condition in expression: Select Yes to consider relational operators in an expression (for example: y = ( a>0 ) ) as conditions.

  • Ternary coverage (for C and C++ only): For C and C++, when this option is selected, Code Coverage is extended to ternary expressions as statement blocks.

  • Information Mode: This setting specifies the Instrumentation Modes to be used by Code Coverage.

    • Default (Optimized for Code Size and Speed): This setting uses one byte per branch to indicate branch coverage.

    • Compact (Optimized for Memory): This setting uses one bit per branch. This method saves target memory but uses more CPU time.

    • Report Hit Count: This adds information about the number of times each branch was executed. This method uses one integer per branch.

  • Ada specification (For Ada only): Selecting this option extends instrumentation to Ada package specifications. Specifications can contain calls and conditions. In this case, the specification file must be included in the application node.

  • Excluded function calls: Specifies a list of functions to be excluded from the call coverage instrumentation type, such as printf or fopen. Use the Add, Remove buttons to tell Code Coverage the functions to be excluded.

  • Exclude for loops (for C and C++ only): Select Yes to exclude for loops from instrumentation. Only while and do loops are instrumented.

  • Bitwise as logical (for C and C++ only): Select Yes to instrument bitwise operators as logical when both operands are booleans. SeeBitwise MC/DC coverage.

  • Not returning Functions (for C and C++ only): Type the identifiers (not signatures) of the functions that do not return (functions that execute a longjmp or exit).

  • Generated package prefix (for Ada only): Add a new prefix to Ada packages if the default Code Coverage prefix (atc_) generates conflicts.

  • Generated package suffix (for Ada only): Specifies how Code Coverage names the instrumented Ada packages:

    • Select Standard to use the your package name as a suffix

    • Select Short to reduce the size of the generated package name for compilers that have a package name length limit.

Advanced Options

  • Trace file name (.tio): this allows you to specify a path and filename for the .tio dynamic coverage trace file.

  • Key ignores source file path: Identifies source files based only on the filename instead of the complete path. Use this option to consolidate test results when a same file can be located in different paths. This can be useful in some multi-user environments that use source control. If you use this option, make sure that the source file names used by your application are unique.

  • Compute deprecated metrics: This setting is for compatibility with third party tools designed for earlier versions of the product (before v2002.05). Set this to No in most cases.

  • User comment: This adds a comment to the Code Coverage Report. This can be useful for identifying reports produced under different Configurations. To view the comment, click the a magnifying glass symbol that is displayed at the top of your source code in the Code Coverage Viewer.

  • Report summary: Select Yes to add the coverage summary to the summary text file of the selected node.

  • On the fly frequency dump (for C and C++ only): Specify the function call number after which the coverage results are updated dynamically during execution. 0 means no update during execution.

To change the Code Coverage Instrumentation Control setting for an application or test node.

  1. In the Project Explorer, click the Settings button.

  2. Select a node in the Project Explorer pane.

  3. In the Configuration Settings list, expand Runtime Analysis and select Coverage.

  4. Select Instrumentation Control.

  5. When you have finished, click OK to validate the changes.

Related Topics

Using Runtime Analysis Features | Configuration Settings | Selecting Coverage Types