Load Stored Coverage Test Results with cvload

The cvload command loads into memory the coverage tests and results stored in a file by the cvsave command. The following example loads the tests and data stored in the text file filename.cvt:

[cvtos, cvdos] = cvload(filename)

The cvtest objects that are loaded are returned in cvtos, a cell array of cvtest objects. The cvdata objects that are loaded are returned in cvdos, a cell array of cvdata objects. cvdos has the same size as cvtos, but can contain empty elements if a particular test has no results.

In the following example, if restoretotal is 1, the cumulative results from prior runs are restored:

[cvtos, cvdos] = cvload(filename, restoretotal)

If restoretotal is unspecified or 0, the model's cumulative results are cleared.

cvload Special Considerations

When using the cvload command, be aware of the following considerations:

  • When a model with the same name exists in the coverage database, only the compatible results are loaded from the file. They reference the existing model to prevent duplication.

  • When the Simulink® models referenced in the file are open but do not exist in the coverage database, the coverage tool resolves the links to the models that are already open.

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