generateHTMLReport
Class: matlab.unittest.TestResult
Package: matlab.unittest
Syntax
Description
generateHTMLReport(
generates a test
report from the test results in HTML format and saves it to a temporary folder. By default,
the method names the main file of the report results
)index.html
.
Use this method to generate an HTML test report once the test run is complete and the test results are available.
generateHTMLReport(
saves the report to the specified folder.results
,folderName
)
generateHTMLReport(___,MainFile=
generates a report with the specified name for the main HTML file. You can specify the file
name as the last argument in any of the previous syntaxes. For example,
fileName
)generateHTMLReport(results,MainFile="main.html")
generates a test
report whose main file is main.html
.
Input Arguments
Examples
Limitations
A test report generated by the
generateHTMLReport
method does not include the text output from the Command Window.
Tips
When you generate a test report from test results that are created by a default runner, the report includes diagnostics for failing events and messages logged at the
matlab.automation.Verbosity.Terse
level. To generate a test report that includes diagnostics for passing events or messages logged at different verbosity levels, first customize your test run by adding aDiagnosticsRecordingPlugin
instance to the runner. For example, run your tests and generate a test report that includes passing diagnostics and messages logged at all verbosity levels.import matlab.unittest.plugins.DiagnosticsRecordingPlugin import matlab.automation.Verbosity suite = testsuite("sampleTest"); runner = testrunner("minimal"); runner.addPlugin(DiagnosticsRecordingPlugin( ... IncludingPassingDiagnostics=true,LoggingLevel=Verbosity.Verbose)) results = run(runner,suite); generateHTMLReport(results)
To generate a test report without explicitly collecting the test results, customize your test run by adding a
TestReportPlugin
instance to the test runner.
Version History
Introduced in R2022a