Package: matlab.unittest.plugins
Plugin to fail tests that issue warnings
The FailOnWarningsPlugin
creates a plugin that,
when added to the TestRunner
, fails any test that issues
a warning. The plugin produces a qualification failure in the test
scope that issues the warning. For example, if a shared test fixture
issues a warning, the plugin produces a qualification failure on the
fixture and fails all tests that share the fixture.
The FailOnWarningsPlugin
plugin does not produce
a failure if:
A test accounts for the warning through a constraint
such as IssuesWarnings
or IssuesNoWarnings
,
regardless of whether the constraint is satisfied or not.
A warning is disabled. For example, if you disable
a warning using the SupressedWarningsFixture
.
matlab.unittest.plugins.FailOnWarningsPlugin
creates
a plugin that fails any test that issues a warning.
matlab.unittest.plugins.FailOnWarningsPlugin('Ignoring',
creates
a plugin that does not fail for the specified warning identifiers, warnIDs
)warnIDs
.
Handle. To learn how handle classes affect copy operations, see Copying Objects.
Set the warning stack trace display using the warning
function.
For example, warning('off','backtrace')
.
Disable warnings using the SuppressedWarningsFixture
class.
matlab.unittest.TestRunner
| matlab.unittest.constraints.IssuesNoWarnings
| matlab.unittest.constraints.IssuesWarnings
| matlab.unittest.fixtures.SuppressedWarningsFixture
| matlab.unittest.plugins.TestRunnerPlugin
| warning