runTestClass

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

Extend running of TestSuite array from same class or function

Syntax

runTestClass(plugin,pluginData)

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 test framework evaluates this method within the scope of the runTestSuite method of the TestRunnerPlugin. It evaluates this method between setting up and tearing down the shared test fixture (setupSharedTestFixture and teardownSharedTestFixture). Provided the test framework completes shared test fixture setup, it invokes this method one time per test class.

Input Arguments

plugin

Instance of matlab.unittest.plugins.TestRunnerPlugin.

pluginData

Test suite 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 runTestClass(plugin, pluginData)
            fprintf('### Running test class: %s\n', pluginData.Name)
            
            runTestClass@matlab.unittest.plugins.TestRunnerPlugin(...
                plugin, pluginData);
        end
    end
end

Introduced in R2014a

Was this topic helpful?