Skip to Main Content Skip to Search
Product Documentation

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.

Input Arguments

root

Name or handle for a Simulink model or a subsystem. Only the specified model or subsystem and its descendants are subject to model coverage testing.

label

Label for test object

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.

Output Arguments

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 MCDC 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' — Disables coverage for all referenced models.

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

  • 'filtered' — Enables 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 program files called by 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 for the Adjustable Rate Limiter block in the slvnvdemo_ratelim_harness model 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                      % Display content of test object

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-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS