Main Content

setupSharedTestFixture

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

Extend setting up shared test fixture

Description

example

setupSharedTestFixture(plugin,pluginData) extends the setting up of a shared test fixture. This method defines how the TestRunner performs shared fixture setup. The testing framework evaluates this method one time for each shared test fixture, within the scope of the runTestSuite method of TestRunnerPlugin.

Input Arguments

plugin

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

pluginData

Shared test fixture setup information, specified as an instance of the matlab.unittest.plugins.plugindata.SharedTestFixturePluginData class. The testing framework uses this information to describe the test content to the plugin.

Examples

expand all

Display the shared test fixture name at setup time.

classdef ExamplePlugin < matlab.unittest.plugins.TestRunnerPlugin
   
    methods (Access = protected)
        function setupSharedTestFixture(plugin, pluginData)
            fprintf('### Setting up: %s\n', pluginData.Name)
            setupSharedTestFixture@matlab.unittest.plugins.TestRunnerPlugin...
                (plugin, pluginData);
        end
    end
end
Introduced in R2014a