Documentation Center

  • Trial Software
  • Product Updates

addPlugin

Class: matlab.unittest.TestRunner
Package: matlab.unittest

Add plugin to TestRunner object

Syntax

addPlugin(runner,plugin)

Description

addPlugin(runner,plugin) adds plugin to runner.

Input Arguments

runner

matlab.unittest.TestRunner object.

plugin

Mechanism provided to customize the manner in which a TestSuite array is run, specified as a TestRunnerPlugin object.

Examples

expand all

Run Test with Custom Plugin

Add matlab.unittest classes to the current import list.

import matlab.unittest.TestRunner;
import matlab.unittest.TestSuite;

Create a TestSuite array.

suite = TestSuite.fromClass(?mypackage.MyTestClass);

Create a TestRunner object.

runner = TestRunner.withNoPlugins;

Add a custom plugin.

import matlab.unittest.plugins.DiagnosticsValidationPlugin; 
runner.addPlugin(DiagnosticsValidationPlugin);

Run the test.

result = run(runner,suite);
Was this topic helpful?