Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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

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?