Create HTML coverage report from model coverage objects
Create a Coverage Report
Set your current folder to a writeable directory.
Open your model and collect coverage by using
modelName = 'slvnvdemo_cv_small_controller'; open_system(modelName); cvd = cvsim(modelName);
Create a coverage report for the model and save the report as
outfile = 'ratelim_coverage.html'; cvhtml(outfile,cvd);
cvdo — Coverage data
cvdata object |
Coverage data, specified as a
cvdata object or
file — File name of the generated report
character array |
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.
options — Report options
Report options, specified as a character vector or string that consists of
an option from the table, an equal sign, and
To enable an option, use
To disable an option, use
To specify multiple report options, list the options in a single character vector or string separated by commas or spaces.
"-hTR=1 -bRG=0 -scm=0"
Web view mode
Include each test in the model summary
Produce bar graphs in the model summary
Use two-color bar graphs
Display hit/count ratio in the model summary
Exclude execution metric details from report
Exclude fully covered model objects from report
Exclude fully covered model object details from report
Include cyclomatic complexity numbers in summary
Include cyclomatic complexity numbers in block details
Filter Stateflow® events from report
simMode — Simulation mode
Simulation mode, specified as one of these values:
Model in Normal simulation mode
Model in software-in-the-loop (SIL) or processor-in-the-loop (PIL) simulation mode
Model reference in SIL or PIL simulation mode
Model reference in SIL or PIL simulation mode with code interface set to top model
Use the Simulink® Editor to generate a coverage report when you simulate the model:
Open the model for which you want a model coverage report.
In the Simulink Editor, in the Modeling tab, select Model Settings.
In the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
Click Run (Coverage) to simulate the model. When the simulation completes, the coverage report opens in the Coverage Details pane.