Documentation Center

  • 評価版
  • 製品アップデート

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.

filter.fileName

String specifying name of coverage filter file, if you have excluded objects from coverage recording. See Coverage Filter Rules and Files.

Examples

Create a cvtest object for the Adjustable Rate Limiter block in the slvnvdemo_ratelim_harness model. Simulate and get coverage data using cvsim.

open_system('slvnvdemo_ratelim_harness');
testObj = cvtest(['slvnvdemo_ratelim_harness', ...
	'/Adjustable Rate Limiter']);
testObj.label = 'Gain within slew limits';
testObj.setupCmd = ...
	'load(''slvnvdemo_ratelim_harness_data.mat'');';
testObj.settings.decision = 1;
testObj.settings.overflowsaturation = 1;
cvdo = cvsim(testObj);

See Also

|

Was this topic helpful?