Main Content

cvhtml

Create HTML coverage report from model coverage objects

Description

cvhtml(file,cvdo) creates an HTML report of the coverage results in the cvdata or cv.cvdatagroup object cvdo with the file name file. The model must be open when you call cvhtml.

cvhtml(file,cvdo1,...,cvdoN) creates a combined report from several cvdata objects. The results from each object appear in a separate column of the HTML report. Each cvdata object must correspond to the same root model or subsystem.

cvhtml(file,cvdo1,...,cvdoN,options) creates a combined report from several cvdata objects using the report options specified by options.

cvhtml(file,cvdo,simMode) creates an HTML report for the models that have the simulation mode simMode.

Examples

collapse all

Set your current folder to a writeable directory.

Open your model and collect coverage by using cvsim.

modelName = 'slvnvdemo_cv_small_controller'; 
open_system(modelName);
cvd = cvsim(modelName); 

Create a coverage report for the model and save the report as ratelim_coverage.html.

outfile = 'ratelim_coverage.html';
cvhtml(outfile,cvd);

Input Arguments

collapse all

Coverage data, specified as a cvdata object or cv.cvdatagroup object.

Data Types: cvdata | cv.cvdatagroup

File name of the generated report, specified as a character array or string array. Specify the absolute path or relative path and the file name.

Report options, specified as a character vector or string that consists of an option from the table, an equal sign, and 0 or 1.

  • To enable an option, use 1.

Example: "-hTR=1"

  • To disable an option, use 0.

Example: "-sRT=0"

  • To specify multiple report options, list the options in a single character vector or string separated by commas or spaces.

Example: "-hTR=1 -bRG=0 -scm=0"

OptionDescriptionDefault

-sRT

Show report

on

-sVT

Web view mode

off

-aTS

Include each test in the model summary

on

-agT

Show aggregated tests information in coverage report

on

-bRG

Produce bar graphs in the model summary

on

-bTC

Use two-color bar graphs

on

-hTR

Display hit/count ratio in the model summary

off

-xEM

Exclude execution metric details from report

off

-nFC

Exclude fully covered model objects from report

off

-nFD

Exclude fully covered model object details from report

off

-scm

Include cyclomatic complexity numbers in summary

on

-bcm

Include cyclomatic complexity numbers in block details

on

-xEv

Filter Stateflow® events from report

off

-req

Include linked requirements in coverage report

on

Data Types: char | string

Simulation mode, specified as one of these values:

Object SpecificationDescription

"Normal"

Model in Normal simulation mode

"SIL" (or "PIL")

Model in software-in-the-loop (SIL) or processor-in-the-loop (PIL) simulation mode

"ModelRefSIL" (or "ModelRefPIL")

Model reference in SIL or PIL simulation mode

"ModelRefTopSIL" (or "ModelRefTopPIL")

Model reference in SIL or PIL simulation mode with code interface set to top model

Alternatives

Use the Simulink® Editor to generate a coverage report when you simulate the model:

  1. Open the model for which you want a model coverage report.

  2. In the Simulink Editor, in the Modeling tab, select Model Settings.

  3. In the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.

  4. Click OK.

  5. Click Run (Coverage) to simulate the model. When the simulation completes, the coverage report opens in the Coverage Details pane.

Version History

Introduced before R2006a

expand all