Main Content


Merge coverage results from two or more test result sets



mergedcov = sltest.testmanager.mergeCoverage(resultsets) merges coverage results from the CoverageResults property of two or more sltest.testmanager.ResultSet objects. The merged results are returned in the CoverageResults property of a new result set.


collapse all

This example shows how to merge coverage results from two test result sets. One test is a baseline test and the other test is an equivalence test. The MergeCoverage.mldatx test file, which has predefined test suites and test cases, is provided.

Load Test File

tf = sltest.testmanager.TestFile...

Get Test Suites from Test File

ts = tf.getTestSuites;

Run First Test Suite and Obtain Test Results

This test is a baseline test.

resultSet1 = run(ts(1));

Get Test Case from Second Test Suite and Convert to Equivalence Test

tc = ts(2).getTestCases;

Run Second Test Suite and Obtain Results

This test is an equivalence test.

resultSet2 = run(ts(2));

Merge Coverage Results

mergedResults = sltest.testmanager.mergeCoverage...

Display Coverage Results for Result Sets and Merged Results

Create an html file named resultSet1_coverage that contains the baseline test coverage results.



Create an html file named resultSet2_coverage that contains the equivalence test coverage results.



Create an html file named merged_coverage that contains the merged coverage results.



Input Arguments

collapse all

Test result set objects from which to obtain coverage results, specified as an array of two or more sltest.tesmanager.ResultSet objects.

Output Arguments

collapse all

Merged coverage results, returned in the CoverageResults property of a new sltest.tesmanager.ResultSet object. The CoverageResults property value is a vector of cvdata objects.

Version History

Introduced in R2017a