Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Verification and Validation   

cvtest - Create model coverage test specification object

Syntax

cvto = cvtest(root)
cvto = cvtest(root, label)
cvto = cvtest(root, label, setupcmd)

Description

cvto = cvtest(root) creates a test specification object with the handle cvto. Simulate cvto with the cvsim command.

cvto = cvtest(root, label) creates a test object with the label label, which is used for reporting results.

cvto = cvtest(root, label, setupcmd) creates a test object with the setup command setupcmd.

Inputs

label

Label for test object

root

The name of, or a handle to, a Simulink model or a subsystem. Only the specified model or subsystem and its descendants are subject to model coverage testing.

setupcmd

Setup command for creating test object. The setup command is executed in the base MATLAB workspace just prior to running the simulation. This command is useful for loading data prior to a test.

Outputs

cvto

A test specification object with the following structure:

FieldDescription

id

Read-only internal ID

modelcov

Read-only internal ID

rootPath

Name of system or subsystem for analysis

label

String used when reporting results

setupCmd

Command executed in base workspace 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 MC/DC coverage.

settings.sigrange

Set to 1 for signal range coverage.

settings.sigsize

Set to 1 for signal size coverage.

settings.tableExec

Set to 1 for lookup table coverage.

modelRefSettings.
enable

  • 'off' — Disable coverage for all referenced models.

  • 'all' or on — Enable coverage for all referenced models.

  • 'filtered' — Enable coverage only for referenced models not listed in the excludedModels subfield.

modelRefSettings.
excludeTopModel

Set to 1 to exclude coverage for the top model.

modelRefSettings.
excludedModels

String specifying a comma-
separated list of referenced models for which coverage is disabled.

emlSettings.
enableExternal

Set to 1 to enable coverage for external M-files called by Embedded MATLAB functions in your model.

options.
forceBlockReduction

Set to 1 to override the Simulink Block reduction parameter if it is enabled.

Examples

Create a cvtest object of the Adjustable Rate Limiter block in the demo model slvnvdemo_ratelim_harness and display its contents:

open_system('slvnvdemo_ratelim_harness');
testObj1 = cvtest(['slvnvdemo_ratelim_harness', ...
     '/Adjustable Rate Limiter']);
testObj1.label = 'Gain within slew limits';
testObj1.setupCmd = 'load(''within_lim.mat'');';
testObj1.settings.mcdc = 1;
testObj1

See Also

cv.cvtestgroup

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS