runTest

Class: matlab.unittest.plugins.TestRunnerPlugin
Package: matlab.unittest.plugins

Extend running of single Test element

Description

example

runTest(plugin,pluginData) extends the running of a single test suite element. This method allows you to override the method that runs a scalar Test element in the TestSuite array, including the creation of the TestCase, and the TestMethodSetup and TestMethodTeardown routines. Provided the testing framework completes all fixture setup, it invokes this method one time per Test element.

Input Arguments

plugin

Plugin object, specified as an instance of the matlab.unittest.plugins.TestRunnerPlugin class.

pluginData

Test element information, specified as an instance of the matlab.unittest.plugins.plugindata.RunPluginData class. The testing framework uses this information to describe the test content to the plugin.

Examples

expand all

Print the label of the test element at run time.

classdef ExamplePlugin < matlab.unittest.plugins.TestRunnerPlugin
    methods (Access = protected)
        function runTest(plugin, pluginData)
            fprintf('### Running test: %s\n', pluginData.Name)
            runTest@matlab.unittest.plugins.TestRunnerPlugin(...
                plugin, pluginData);
        end
    end
end
Introduced in R2014a