runTest

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

Extend running of single TestSuite element

Syntax

runTest(plugin,pluginData)

Description

example

runTest(plugin,pluginData) extends the running of a single TestSuite element. This method allows the test author 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 test framework completes all fixture setup, it invokes this method one time per test element.

Input Arguments

plugin

Instance of matlab.unittest.plugins.TestRunnerPlugin.

pluginData

Test element information, specified as an instance of matlab.unittest.plugins.plugindata.TestSuiteRunPluginData. The test framework uses this information to introspect into the test content.

Examples

expand all

Print the label of the test content 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

Was this topic helpful?