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,
true for on.
Coverage collection is enabled or disabled in the Test Manager under the Coverage Settings section. This property controls the Record coverage for system under test check box. The Record coverage for referenced models check box must be changed manually in the Test Manager and not programmatically.
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';