runTestMethod

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

Extend running of single Test method

Syntax

runTestMethod(plugin,pluginData)

Description

example

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

Input Arguments

plugin

Instance of matlab.unittest.plugins.TestRunnerPlugin.

pluginData

Test method 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 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

Introduced in R2014a

Was this topic helpful?