sltest.testmanager.CoverageSettings Class
Namespace: sltest.testmanager
Modify coverage settings
Description
Instances of sltest.testmanager.CoverageSettings
let you set the
values in the Coverage Settings section in a test file, test suite,
or test case.
The sltest.testmanager.CoverageSettings
class is a handle
class.
Creation
The getCoverageSettings
methods for test file, test
suite, and test case objects return an
sltest.testmanager.CoverageSettings
object, which lets you access
the coverage collection and metric settings.
Properties
RecordCoverage
— Enable coverage collection
false
(default) | true
Specify if the coverage collection is on or off, false
for off and true
for on.
Coverage collection is enabled or disabled in the Test Manager Coverage Settings. The corresponding UI option is Record coverage for system under test.
Example: 'Decision',true
Attributes:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
MdlRefCoverage
— Collect coverage for referenced models
false
(default) | true
Coverage collection for referenced models is enabled or disabled in the Test Manager Coverage Settings. The corresponding UI option is Record coverage for referenced models.
Example: 'Decision',true
Attributes:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
MetricSettings
— Coverage metric setting selection
string
Selection of coverage settings that are enabled or disabled, specified as
a string. For the set of possible strings, see the parameter info for
CovMetricSettings
in Coverage metric
settings (Simulink Coverage) and sltest.plugins.coverage.CoverageMetrics
. You can modify
coverage metric settings only at the test file level.
Coverage metrics are enabled or disabled in the Test Manager by selecting the check boxes in the Coverage Settings section.
Example: "dw"
Attributes:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
ExcludeInactiveVariants
— Inactive variants setting for coverage
false
or 0
(default) | true
or 1
Inactive variants setting for coverage, specified as a logical
0
(false
) to include inactive
variants in coverage, or 1
(true
) to
exclude them. An inactive variant is not active at
any time while the test runs. This
ExcludeInactiveVariants
property
applies to these blocks:
Variant blocks in Simulink® with Variant activation time set to startup
Variant configurations in Stateflow® charts
You can modify the inactive variants setting only at the test file level. Excluding inactive variant is enabled or disabled in the Test Manager by selecting the check box in the Coverage Settings section. For more information, see Model Coverage for Variant Blocks (Simulink Coverage).
Attributes:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
CoverageFilterFilename
— Coverage filter to use for coverage analysis
string array
The filename of a coverage filter file or files on the MATLAB® path, specified as a string array. The filenames specify the
coverage filters that override filter files specified in the model
configuration settings. An empty value, ""
, attaches
no coverage filter. For more information
on coverage filters, see Coverage Filtering (Simulink Coverage). The coverage filter setting
propagates down from test files to test suites and test cases, and its
results are displayed at the Result Set level.
Specify the coverage filter filename in the Test Manager, in the Coverage filter filename table of the Coverage Settings section.
Example: "covfilter.cvf"
Example: ["covfilter.cvf";"covfilter2.cvf"]
Example: ""
Attributes:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Examples
Enable MCDC and Signal Range Coverage Metrics and Specify a Coverage Filter
% Get coverage settings object from the test file cov = getCoverageSettings(testfile); cov.RecordCoverage = true; % Enable MCDC and signal range coverage metrics cov.MetricSettings = "mr"; % Specify a coverage filter cov.CoverageFilterFilename = "covfilter.cvf";
Version History
Introduced in R2016a
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)