User`s guide

Create Tests with cvtest
21-3
Create Tests with cvtest
The cvtest command creates a test specification object. Once you create the object, you
simulate it with the cvsim command.
The call to cvtest has the following default syntax:
cvto = cvtest(root)
root is the name of, or a handle to, a Simulink model or a subsystem of a model. cvto is
a handle to the resulting test specification object. Only the specified model or subsystem
and its descendants are subject to model coverage.
To create a test object with a specified label (used for reporting results):
cvto = cvtest(root, label)
To create a test with a setup command:
cvto = cvtest(root, label, setupcmd)
You execute the setup command in the base MATLAB workspace, just prior to running
the instrumented simulation. Use this command for loading data prior to a test.
The returned cvtest object, cvto, has the following structure.
Field Description
id Read-only internal data-dictionary ID
modelcov Read-only internal data-dictionary ID
rootPath Name of the system or subsystem for
analysis
label String for reporting results
setupCmd Command executed prior to simulation
settings.condition Set to 1 for condition coverage
settings.decision Set to 1 for decision coverage
settings.
designverifier
Set to 1 for coverage for Simulink Design
Verifier blocks.
settings.mcdc Set to 1 for MCDC coverage