You can edit the configuration settings for code coverage to explicitly include or
exclude files, change the information mode, coverage level, and other settings.
Procedure
-
In the Project Explorer, click the
Settings
icon.
-
Select a node in the Project Explorer pane.
-
In the Configuration Settings list, expand Runtime
Analysis and Code Coverage.
- Instrumentation control
- You can use the coverage type settings to declare various types of
coverage. See Coverage levelsfor more information
about these settings.
- Coverage level functions
- Select between function Entries, With
exits, or None.
-
- Coverage level calls
- Select Yes or No to toggle call code
coverage.
-
- Coverage level blocks
- Select the desired block code coverage type. 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
coverage viewer.
-
- Exclude for loops
- Select Yes to exclude for loops from
instrumentation. Only while and do loops are
instrumented.
-
- Coverage level conditions
- Selects the condition level of code coverage to be
included in the report:
-
- None: The coverage report ignores
conditions.
- 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.
-
- Condition in expressions
- Select Yes to consider relational operators in an
expression (for example: y = ( a>0 ) ) as
conditions.
-
- Bitwise as logical
- Select Yes to instrument bitwise operators as
logical when both operands are booleans.
-
- Ternary coverage
- When this option is selected, code coverage reports
ternary expressions as statement blocks.
-
- Information mode
- This setting specifies the information 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.
-
- 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 specify
the functions to be excluded.
-
- Not returning functions
- Type the identifiers (not signatures) of the functions
that do not return (functions that execute a
longjmp or exit).
- Advanced options
-
- Trace file name (.tio)
- This allows you to specify a path and filename for the
.tio
dynamic coverage trace
file.
-
- Key ignore 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.
-
- 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 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
- Specify the function call number after which the
coverage results are updated dynamically during
execution. 0 means no update during execution.
-
- Coverage Report Template
- An HTML coverage report is automatically generated after
each execution. This report is based on a template as
default
<installation
folder>/lib/reports/covreport.template
.You
can make a copy of this template and modify it. This
option is used to point to the new template file.
-
- Generate raw data in JSON
- Select Yes if you want to generate the coverage
raw data in a JSON file, Yes, in compressed mode
if you want to compress this file, No if you do
not need this JSON file. The name of this file is the
same as the name of the HTML report file where
.html
is replaced by
.json
.
-
Click OK to validate your changes.