Main Content

runTestClass

Class: matlab.unittest.plugins.TestRunnerPlugin
Package: 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 being run by the TestRunner. The testing framework evaluates this method within the scope of the runTestSuite method of TestRunnerPlugin. 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

plugin

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

pluginData

Information about the Test elements being run, 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 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
Introduced in R2014a