Main Content


Class: sltest.testmanager.ResultSet
Package: sltest.testmanager

Get coverage results


covResult = getCoverageResults(result)
covResult = getCoverageResults(result,model)


covResult = getCoverageResults(result) gets the coverage results that belong to the result set object.

covResult = getCoverageResults(result,model) gets the coverage results that belong to the result set object and the specified model.

Input Arguments

expand all

Result set object to get coverage results from, specified as a sltest.testmanager.ResultSet object.

Name of a model within the set of coverage results, specified as a character vector.

Output Arguments

expand all

Coverage results contained in the result set, returned as an array of cvdata objects. For more information on cvdata objects, see cv.cvdatagroup (Simulink Coverage).


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

% Run the test case and return an object with results data
ro = run(tf);

% Get the coverage results
cr = getCoverageResults(ro);
Introduced in R2016a