This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Class: sltest.testmanager.TestCase
Package: sltest.testmanager

Get coverage settings


covSettings = getCoverageSettings(tc)


covSettings = getCoverageSettings(tc) gets the coverage settings for a test case and returns an sltest.testmanager.CoverageSettings object.

Input Arguments

expand all

Test case to get coverage settings from, specified as an sltest.testmanager.TestCase object.

Output Arguments

expand all

Coverage settings for the test case, returned as ansltest.testmanager.CoverageSettings object.


expand all

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'simulation','Coverage Test Case');

% Remove the default test suite
tsDel = getTestSuiteByName(tf,'New Test Suite 1');

% Assign the system under test to the test case

% Turn on coverage settings at test-file level
cov = getCoverageSettings(tf);
cov.RecordCoverage = true;

% Enable MCDC and signal range coverage metrics
cov.MetricSettings = 'mr';

% Get and check coverage settings
covSettings = getCoverageSettings(tc);

Introduced in R2016a