Main Content

sltest.testmanager.mergeCoverage

Merge coverage results from two or more test result sets

Description

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.

example

Examples

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...
    ('MergeCoverage.mldatx');

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;
tc.convertTestType...
    (sltest.testmanager.TestCaseTypes.Equivalence);

Run Second Test Suite and Obtain Results

This test is an equivalence test.

resultSet2 = run(ts(2));

Merge Coverage Results

mergedResults = sltest.testmanager.mergeCoverage...
    ([resultSet1,resultSet2]);

Display Coverage Results for Result Sets and Merged Results

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

cvhtml('resultSet1_coverage',resultSet1.CoverageResults);

1_rs1_cov.png

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

cvhtml('resultSet2_coverage',resultSet2.CoverageResults);

2_rs2_cov.png

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

cvhtml('merged_coverage',mergedResults.CoverageResults);

1_merged_cov.png

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