Main Content


Class: sltest.testmanager.TestSuite
Namespace: sltest.testmanager

Get coverage settings


covSettings = getCoverageSettings(ts)


covSettings = getCoverageSettings(ts) gets coverage settings for a test suite and returns an sltest.testmanager.CoverageSettings object.

Input Arguments

expand all

Test suite object to get coverage settings from, specified as an sltest.testmanager.TestSuite object.

Output Arguments

expand all

Coverage settings for the test suite, returned as an sltest.testmanager.CoverageSettings object. For information on coverage metrics, see sltest.plugins.coverage.CoverageMetrics.


expand all

% Open the model for this example

% 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;

% Turn off coverage at test-suite level
cov = getCoverageSettings(ts);
cov.RecordCoverage = false;

Version History

Introduced in R2016a