Main Content

runTestClass

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

Extend running of Test elements from same class or function

Description

example

runTestClass(plugin,pluginData) extends the running of tests that belong to the same test class, function, or script. This method applies to a subset of the full TestSuite array being run by the test runner. The testing framework evaluates this method within the scope of the runTestSuite method. It evaluates this method between setting up and tearing down the shared test fixture (setupSharedTestFixture and teardownSharedTestFixture). Provided the testing framework completes shared test fixture setup, it invokes this method one time per test class.

Input Arguments

expand all

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

Information about the Test elements being run, 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 runTestClass method to print the label of the test content at run time.

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

Version History

Introduced in R2014a