Main Content

cvload

Load coverage tests and stored results into memory

    Description

    [covSettings,covData] = cvload(fileName) loads the tests and data stored in the specified file.

    [covSettings,covData] = cvload(fileName,restoreTotal) restores or clears the cumulative results from prior runs depending on the value of restoreTotal.

    Note

    When using the cvload command:

    • If a model with the same name exists in the coverage database, cvload only loads the compatible results that reference the existing model to prevent duplication.

    • If the Simulink® models referenced from the file are open, but do not exist in the coverage database, cvload resolves the links to the existing models.

    • When you are loading several files that reference the same model, cvload only loads the results that are consistent with the earlier files.

    • Starting in R2020b, you can load coverage data created in R2017b or later. You can aggregate coverage data from two or more cvdata objects for the same model if the dbVersion properties match.

    Examples

    collapse all

    Load the file myCovData.cvt while maintaining cumulative coverage results.

    [covSettings,covData] = cvload('myCovData',1);

    Input Arguments

    collapse all

    Name of coverage data file, specified as a character array or string array. fileName must be a coverage data file with the .cvt extension. You do not need to include the extension in fileName.

    Example: 'myCoverageData'

    Data Types: char | string

    Cumulative data restoration setting, specified as 1 or 0. If restoreTotal is set to 1, cvload restores the cumulative results from prior runs. If restoreTotal is set to 0 or unspecified, cvload clears the cumulative results.

    Data Types: double

    Output Arguments

    collapse all

    Coverage settings, returned as a cell array of cvtest objects. The coverage settings are returned as cvtest objects even if you did not use cvtest and cvsim to collect the original data.

    Data Types: cell

    Coverage data, returned as a cell array of cvdata objects. covData has the same size as covSettings, but if a settings entry has no results, covData can contain empty elements.

    Alternatives

    You can load existing coverage data in the Coverage Results Explorer:

    1. Open the model for which you want to load existing coverage data.

    2. In the Apps tab, select Coverage Analyzer.

    3. In the Coverage tab, select Results Explorer.

    4. In the Coverage Results Explorer, right click Data Repository and select Load coverage data.

    5. Select the coverage data file that you want to load.

    Version History

    Introduced before R2006a

    expand all