Main Content

cvhtml

Produce HTML 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 when you run model coverage in simulation. cvhtml saves the coverage results in file. The model must be open when you use cvhtml to generate its coverage report.

cvhtml(file,cvdo1,...,cvdoN) creates a combined report of 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. Otherwise, the function fails.

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

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

Examples

collapse all

Make sure you have write access to the default MATLAB® folder. Create a cumulative coverage report for the slvnvdemo_cv_small_controller mode and save it as ratelim_coverage.html:

model = 'slvnvdemo_cv_small_controller'; 
open_system(model);
cvt = cvtest(model);
cvd = cvsim(cvt); 
outfile = 'ratelim_coverage.html';
cvhtml(outfile, cvd);

Input Arguments

collapse all

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

HTML file name, specified as a character or string array. You can specify the absolute path or relative path and the HTML file where cvhtml stores the report.

Reporting options, specified as a character or string array.

  • To enable an option, set it to 1 (e.g., '-hTR=1').

  • To disable an option, set it to 0 (e.g., '-bRG=0').

  • To specify multiple report options, list individual options in a single options character vector or string separated by commas or spaces (e.g., '-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

-bRG

Produce bar graphs in the model summary

on

-bTC

Use two color bar graphs (red, blue)

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

on

-scm

Include cyclomatic complexity numbers in summary

on

-bcm

Include cyclomatic complexity numbers in block details

on

-xEv

Filter Stateflow® events from report

off

Simulation mode, specified as a character or string array. Valid values include the following:

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 Software-in-the-Loop (SIL) or Processor-in-the-Loop (PIL) simulation mode.

'ModelRefTopSIL' (or 'ModelRefTopPIL')

Model reference in Software-in-the-Loop (SIL or Processor-in-the-Loop (PIL) simulation mode with code interface set to top model.

Alternatives

Use the coverage settings to create a model coverage report in an HTML file:

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

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

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

  4. Click OK to close the Configuration Parameters dialog box and save your changes.

  5. Simulate the model by clicking the Run button and review the generated report.

Introduced before R2006a