generatePDFReport
Class: matlab.unittest.TestResult
Namespace: matlab.unittest
Syntax
Description
generatePDFReport(
generates a test
report from the test results in PDF format and saves it to a temporary folder.results
)
Use this method to generate a PDF test report once the test run is complete and the test results are available.
generatePDFReport(___,
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
)generatePDFReport(results,PageOrientation="landscape")
generates a test
report in landscape orientation.
Input Arguments
Examples
Limitations
A test report generated by the
generatePDFReport
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); generatePDFReport(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.PDF test reports are generated based on your system locale and the font families installed on your machine. When generating a report with a non-English locale, unless your machine has the Noto Sans CJK font families installed, the report might have pound sign characters (#) in place of Chinese, Japanese, and Korean characters.