Programmatically Access Test Diagnostics - MATLAB & Simulink (original) (raw)

Main Content

In certain cases, the testing framework uses a DiagnosticsRecordingPlugin instance to record diagnostics on test results. The framework uses the plugin by default if you take any of these actions:

After your tests run, you can access recorded diagnostics using theDiagnosticRecord field in the Details property of TestResult objects. For example, if your test results are stored in the variable results, thenresult(2).Details.DiagnosticRecord contains the recorded diagnostics for the second test in the suite.

The recorded diagnostics are DiagnosticRecord objects. To access particular types of test diagnostics for a test, use the selectFailed,selectPassed, selectIncomplete, andselectLogged methods of the DiagnosticRecord class.

By default, the plugin records failing events and events logged at thematlab.automation.Verbosity.Terse level. To record passing diagnostics or messages logged at higher verbosity levels, create an instance ofDiagnosticsRecordingPlugin and add it to the test runner.

See Also

Classes

Topics