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.
% Get coverage settings object from the test file cov = getCoverageSettings(testfile); cov.RecordCoverage = true; % Enable MCDC and signal range coverage metrics cov.MetricSettings = 'mr';