Main Content

runTestMethod

Class: matlab.unittest.plugins.TestRunnerPlugin
Namespace: matlab.unittest.plugins

Extend running of single Test method

Description

runTestMethod(plugin,pluginData) extends the running of a single Test method. The testing framework evaluates this method within the scope of the runTest method. It evaluates this method between setting up and tearing down the scalar TestSuite element (setupTestMethod and teardownTestMethod).

example

Input Arguments

expand all

Plugin, specified as a matlab.unittest.plugins.TestRunnerPlugin object.

Test method information, specified as a matlab.unittest.plugins.plugindata.RunPluginData object. The testing framework uses this information to describe the test content to the plugin.

Attributes

Accessprotected

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Create a plugin and override the runTestMethod method to print the time taken to evaluate the Test method.

classdef ExamplePlugin < matlab.unittest.plugins.TestRunnerPlugin
    methods (Access=protected)
        function runTestMethod(plugin,pluginData)
            tic
            runTestMethod@ ...
                matlab.unittest.plugins.TestRunnerPlugin(plugin,pluginData)
            fprintf('### %s ran in %f seconds excluding fixture time.', ...
                pluginData.Name,toc)
        end
    end
end

Version History

Introduced in R2014a