generateDOCXReport
Class: matlab.unittest.TestResult
Namespace: matlab.unittest
Syntax
Description
generateDOCXReport(
generates a test
report from the test results in DOCX format and saves it to a temporary folder.results
)
Use this method to generate a DOCX test report once the test run is complete and the test results are available.
generateDOCXReport(___,
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
)generateDOCXReport(results,PageOrientation="landscape")
generates a
test report in landscape orientation.
Input Arguments
Examples
Limitations
A test report generated by the
generateDOCXReport
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); generateDOCXReport(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.