Modify coverage settings
you set the setting under the Coverage Settings section
in a test file, test suite, or test case.
getCoverageSettings methods for test file,
test suite, and test case objects returns a
which lets you access the coverage collection and metric settings.
RecordCoverage— Enable coverage collection
Specify if the coverage collection is on or off,
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.
MdlRefCoverage— Collect coverage for referenced models
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.
MetricSettings— Coverage metric setting selection
Selection of coverage settings that are enabled or disabled, specified as
a character vector. For the set of possible character vectors, see the
parameter info for
CovMetricSettings in Model Parameters (Simulink). Coverage
metric settings can be modified only at a test-file level.
Coverage metrics are enabled or disabled in the Test Manager by selecting the check boxes in the Coverage Settings section.
CoverageFilterFilename— Coverage filter to use for coverage analysis
Absolute path or relative path of a coverage filter to use during coverage
analysis, or the file name of a coverage filter on the path, specified as a
character vector. The default setting,
Settings]', honors the model configuration parameter settings. An
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, or from test suites to test
Specify the coverage filter filename in the Test Manager, in the Coverage filter filename field of the Coverage Settings section.
'[Model Settings]' (default)
% 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';