Contenido principal

slcoverage.showDataMergeIssues

Display issues that prevent coverage data aggregation

Since R2026a

    Description

    slcoverage.showDataMergeIssues analyzes the Simulink® Test™ result sets that are loaded in Simulink Test Manager and displays a summary of the differences in the coverage results that can cause the coverage data to be incompatible for aggregation.

    slcoverage.showDataMergeIssues(resultSet) displays a summary of differences in the coverage results that can cause the coverage data to be incompatible for aggregation.

    slcoverage.showDataMergeIssues(covData1,covData2) displays a summary of differences between covData1 and covData2 that can cause the coverage data to be incompatible for aggregation.

    Examples

    collapse all

    Analyze the result sets loaded in Simulink Test Manager and identify differences between the coverage results of the test cases that can result in the coverage data being incompatible for aggregation.

    Load a test file into Simulink Test Manager.

    sltest.testmanager.load("variant-merge.mldatx")

    Run the loaded tests by calling sltest.testmanager.run with no input arguments.

    sltest.testmanager.run;

    Display the coverage data aggregation issues for the loaded result sets by calling slcoverage.showDataMergeIssues with no input arguments.

    slcoverage.showDataMergeIssues
    -----------------------------------------------------------
    -- Simulink Test Manager Coverage Incompatibility Report --
    -----------------------------------------------------------
    
    RESULT SET: 'Results: 2025-Feb-25 21:40:48'
    
    SUMMARY
    The analyzed result set contains duplicate coverage rows for the following items:
      (1) AnalyzedModel: 'slcoverageVariants', SimMode: 'Normal', Release: 'R2026a'
    
    -----------------------------------------------------------
    DETAILS for slcoverageVariants - Normal - R2026a
    
     2 coverage results were found with the same AnalyzedModel/SimMode/Release but different checksums.
    
     Source of each aggregated coverage result:
     The following tests contributed to cov result version 1:
       * Results: 2025-Feb-25 21:40:48/variant-merge/Merge Variants Test Suite/Variant Subsystem 1 Active
    
     The following tests contributed to cov result version 2:
       * Results: 2025-Feb-25 21:40:48/variant-merge/Merge Variants Test Suite/Variant Subsystem 2 Active
    
     Cause of differences:
     Coverage result version 1 is incompatible with version 2 due to the following:
    
     [Issue 1]
        Block: slcoverageVariants/Variant_Subsystem/Subsystem2
         ➔ New block added.
    
     [Issue 2]
        Block: slcoverageVariants/Variant_Subsystem/Subsystem1
         ➔ Block was removed.

    Because the test suite changes the active variant between simulations, the analysis reports that a block was removed and a new block was added. For more information about how to resolve this incompatibility, see Find and Resolve Coverage Merge Issues.

    Compare two cvdata objects and display the differences between the objects that can result in coverage data being incompatible for aggregation.

    Generate two coverage results for a model. For example, changing the active variant causes an incompatibility in some cases.

    set_param(gcs,"CovEnable","on");
    set_param(gcs,"CovSaveSingleToWorkspaceVar","on");
    simOut1 = sim(gcs);
    covData1 = simOut1.covdata;
    V = 2;
    simOut2 = sim(gcs);
    covData2 = simOut2.covdata;

    Identify potential issues with coverage data aggregation by analyzing the two cvdata objects.

    slcoverage.showDataMergeIssues(covData1,covData2)
    -----------------------------------
    -- CVDATA Incompatibility Report --
    -----------------------------------
    
     [Issue 1]
        Block: slcoverageVariants/Variant_Subsystem/Subsystem2
         ➔ New block added.
    
     [Issue 2]
        Block: slcoverageVariants/Variant_Subsystem/Subsystem1
         ➔ Block was removed.

    The analysis reports that a block was removed and a new block was added. For more information about how to resolve this incompatibility, see Find and Resolve Coverage Merge Issues.

    Input Arguments

    collapse all

    Simulink Test Manager result set, specified as an sltest.testmanager.ResultSet object or an array of sltest.testmanager.ResultSet objects.

    Example: slcoverage.showDataMergeIssues(resultSet);

    Data Types: sltest.testmanager.ResultSet

    Coverage data, specified as a cvdata object.

    Example: slcoverage.showDataMergeIssues(covData1,covData2);

    Data Types: cvdata

    Version History

    Introduced in R2026a