sltest.testmanager.report
Generate report of test results
Syntax
Description
sltest.testmanager.report(
generates a report from results specified by resultObj,filePath,"IncludeTestResults",testResults)resultObj and
saves the report in the location specified by filePath. Use the
IncludeTestResults argument to specify whether to include
passed, failed, or all results.
sltest.testmanager.report(___,
specifies options using one or more name-value arguments in addition to the input
arguments in previous syntaxes.Name=Value)
Examples
Generate a pdf report that includes only passed results.
filePath = 'testReport.pdf'; sltest.testmanager.report(resultObj,filePath,... 'IncludeTestResults',1);
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);
If you create a custom class to customize how
the report is generated using the sltest.testmanager.TestResultReport class,
then generate the report using:
% Import existing results or use sltest.testmanager.run to run tests % and collect results result = 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
Results set object to get results from, specified as an sltest.testmanager.ResultSet,
sltest.testmanager.TestFileResult, sltest.testmanager.TestSuiteResult, sltest.testmanager.TestCaseResult, or sltest.testmanager.TestIterationResult object.
Filename and path of the generated report, specified as a character vector. File path must have file extension of pdf, docx, or zip, which are the only supported file types.
Include all or a subset of test
results in the report. You can select passed and failed results, specified
as the integer value 0, select only passed results,
specified as the value 1, or select only failed results,
specified as the value 2.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: 'IncludeTestRequirement',true
Name of the report author, specified as a character vector.
Example: 'Test Engineer'
Title of the report, specified as a character vector.
Example: 'Test_Report_1'
Choose to include the version of MATLAB used to run the test cases, specified as a Boolean value,
true or false.
Choose to include the test requirement link defined under
Requirements in the test case, specified as a
Boolean value, true or
false.
Choose to include the simulation output plots of each signal,
specified as a Boolean value, true or
false.
Number of rows of plots to include on report pages, specified as an
integer from 1 to 4. This property is used only if the
IncludeSimulationSignalPlots property is
true.
Number of columns of plots to include on report pages, specified as an
integer from 1 to 4. This property is used only if the
IncludeSimulationSignalPlots property is
true.
Choose to include the signal comparison plots defined under baseline
criteria, equivalence criteria, or assessments using the
verify operator in the test case, specified as a
Boolean value, true or
false.
Option to include the figures opened from a callback script, custom criteria, or by the
model in the report, specified as true or
false.
Choose to include error messages from the test case simulations, specified as a Boolean
value, true or false.
Open the report when it is finished generating, specified as a Boolean
value, true or to not open the report,
false.
Name and path for a Microsoft® Word template file to use for report generation, specified as a character vector. This is an optional argument that is only available if you have a MATLAB Report Generator™ license.
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 a MATLAB Report Generator license.
Option to include coverage metrics that are collected at test execution, specified as a
Boolean value, true or false. For
more information about collecting coverage, see Collect Coverage in Tests.
Option to include simulation metadata for each test case or iteration, specified as a
Boolean value, true or false. The
metadata includes the Simulink® model, model version, model path, simulation mode,
override SIL or PIL mode, configuration set, variant configuration,
solver name and type, max step size, start and stop time, checksum, user
id, machine name, platform, and Simulink version and release.
Since R2025a
Option to include images of executed sequence diagrams, specified as
true or false. When this
option is set to false, the report includes the
sequence diagram names, the result outcome, and the model and harness
names. Set this option to true to include images of
the executed sequence diagrams in the results report.
Version History
Introduced in R2015aUse the IncludeSequenceDiagrams argument to specify whether
to include sequence diagrams in the test results report.
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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)