%% Add Plugin to Test Runner
% This example shows how to add a plugin to the test runner. The matlab.unittest.plugins.TestRunProgressPlugin displays progress messages about a test case. This plugin is part of the matlab.unittest package. MATLAB® uses it for default test runners.
%
%% Create a Test for the BankAccount Class
% In a file in your working folder, create a test file for the BankAccount class.

type BankAccountTest.m

%
%% Create Test Suite
% At the command prompt, create a test suite, ts, from the BankAccountTest test case.

ts = matlab.unittest.TestSuite.fromClass(?BankAccountTest);

%
%% Show Results with No Plugins
% Create a test runner with no plugins.

runner = matlab.unittest.TestRunner.withNoPlugins;
res = runner.run(ts);

% No output displayed.
%
%% Customize Test Runner
% Add the custom plugin, TestRunProgressPlugin.

import matlab.unittest.plugins.TestRunProgressPlugin
runner.addPlugin(TestRunProgressPlugin.withVerbosity(2))
res = runner.run(ts);

% MATLAB displays progress messages about BankAccountTest.
% Copyright 2012 The MathWorks, Inc.