sltest.testmanager.report
Generate report of test results
Description
sltest.testmanager.report(
generates a report of the specified results inresultObj
,filePath
,Name,Value
)resultObj
and saves the report to thefilePath
location.
Examples
Generate a Test Report
Generate a report that includes the test author, test title, and the MATLAB®version used to run the test case. The report includes only failed results.
filePath ='test.pdf'; sltest.testmanager.report(resultObj,filePath,...'Author','TestAuthor',...'Title','Test',...'IncludeMLVersion',true,...'IncludeTestResults',2);
Use Custom Report Class to Generate Report
If you create a custom class to customize how the report is generated using thesltest.testmanager.TestResultReport
class, then generate the report using:
% Import existing results or use sltest.testmanager.run to run tests% and collect resultsresult = sltest.testmanager.importResults('testResults.mldatx'); filePath ='testreport.zip'; sltest.testmanager.report(result,filePath,...'Author','User',...'Title','Test',...'IncludeMLVersion',true,...'IncludeTestResults',int32(0),...'IncludeSimulationSignalPlots',true,...'NumPlotColumnsPerPage',2,...'CustomReportClass','CustomReport',...'LaunchReport',true);
Input Arguments
resultObj
—Results set object
object
Results set object to get results from, specified as ansltest.testmanager.ResultSet
,sltest.testmanager.TestFileResult
,sltest.testmanager.TestSuiteResult
,sltest.testmanager.TestCaseResult
, orsltest.testmanager.TestIterationResult
object.
filePath
—文件名和路径的基因rated report
character vector
文件名和路径的基因rated report, specified as a character vector. File path must have file extension of pdf, docx, or zip, which are the only supported file types.
Name-Value Arguments
Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN
, whereName
is the argument name andValue
is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and encloseName
in quotes.
Example:'IncludeTestRequirement',true
Author
—Report author
empty character vector(default)
Name of the report author, specified as a character vector.
Example:'Test Engineer'
Title
—Report title
'Test'
(default) |character vector
Title of the report, specified as a character vector.
Example:'Test_Report_1'
IncludeMLVersion
—Include the MATLAB version
true
(default) |false
Choose to include the version of MATLAB used to run the test cases, specified as a Boolean value,true
orfalse
.
IncludeTestRequirement
—Include the test requirement
true
(default) |false
Choose to include the test requirement link defined underRequirementsin the test case, specified as a Boolean value,true
orfalse
.
IncludeSimulationSignalPlots
—Include the simulation output plots
false
(default) |true
Choose to include the simulation output plots of each signal, specified as a Boolean value,true
orfalse
.
NumPlotRowsPerPage
—Number of rows of plots to include on report pages
2(default)
Number of rows of plots to include on report pages, specified as an integer from 1 to 4. This property is used only if theIncludeSimulationSignalPlots
property istrue
.
NumPlotColumnsPerPage
—Number of columns of plots to include on report pages
1(default)
Number of columns of plots to include on report pages, specified as an integer from 1 to 4. This property is used only if theIncludeSimulationSignalPlots
property istrue
.
IncludeComparisonSignalPlots
—Include the comparison plots
false
(default) |true
Choose to include the signal comparison plots defined under baseline criteria, equivalence criteria, or assessments using theverify
operator in the test case, specified as a Boolean value,true
orfalse
.
IncludeMATLABFigures
—Option to include figures
false
(default) |true
Option to include the figures opened from a callback script, custom criteria, or by the model in the report, specified astrue
orfalse
.
IncludeErrorMessages
—Include error messages
true
(default) |false
Choose to include error messages from the test case simulations, specified as a Boolean value,true
orfalse
.
IncludeTestResults
—Include all or subset of test results
2
(default) |0
|1
Option to include all or a subset of test results in the report. You can select passed and failed results, specified as the integer value0
, select only passed results, specified as the value1
, or select only failed results, specified as the value2
.
LaunchReport
—Open report at completion
true
(default) |false
Open the report when it is finished generating, specified as a Boolean value,true
or to not open the report,false
.
CustomTemplateFile
—Path to document template
character vector
Name and path for aMicrosoft®Wordtemplate file to use for report generation, specified as a character vector. This is an optional argument that is only available if you have aMATLAB Report Generator™license.
CustomReportClass
—Class name for customized report
character vector
Name of the class used for report customization, specified as a character vector. This is an optional argument that is only available if you have aMATLAB Report Generatorlicense.
IncludeCoverageResult
—Include coverage result metrics
false
(default) |true
Choose to include coverage metrics that are collected at test execution, specified as a Boolean value,true
orfalse
. For more information about collecting coverage, seeCollect Coverage in Tests.
IncludeSimulationMetadata
—Include simulation metadata
false
(default) |true
Choose to include simulation metadata for each test case or iteration, specified as a Boolean value,true
orfalse
. The metadata includes: Simulink®version, model version, model author, date, model user ID, model path, machine name, solver name, solver type, fixed step size, simulation start time, simulation stop time, and platform.
Version History
Introduced in R2015a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)