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(___,
specifies options using one or more name-value arguments in addition to any of the input
argument combinations in previous syntaxes. For example,
Name=Value
)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.