Main Content

sltest.testmanager.ParameterOverride Class

Namespace: sltest.testmanager

Add or modify parameter override

Description

Instances of sltest.testmanager.ParameterOverride are parameter overrides contained in a parameter set within a test case that can override model parameters. Parameter overrides are not evaluated until test run time.

The sltest.testmanager.ParameterOverride class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

obj = sltest.testmanager.ParameterSet.addParameterOverride creates a sltest.testmanager.ParameterOverride object for a parameter set object.

Properties

expand all

Name of the parameter override, specified as a string scalar or character vector.

Attributes:

SetAccess
public
GetAccess
public
Dependent
true
NonCopyable
true

Value of the parameter override, specified as a scalar or vector value. If the value is a string scalar, it is evaluated as a MATLAB® expression when the test executes.

Attributes:

SetAccess
public
GetAccess
public
Dependent
true
NonCopyable
true

Indicates if the parameter override is enabled, 0 if it is not enabled, or 1 if it is enabled.

Attributes:

SetAccess
public
GetAccess
public
Dependent
true
NonCopyable
true

Source of the parameter override, returned as a character vector. Two examples of sources are the base workspace and a Model block. The parameter is read-only.

Attributes:

SetAccess
private
GetAccess
public
Dependent
true
NonCopyable
true

Workspace of the parameter to override, returned as a character vector. The parameter is read-only.

Attributes:

SetAccess
private
GetAccess
public
Dependent
true
NonCopyable
true

Methods

expand all

Examples

collapse all

Open the model for this example.

sldemo_absbrake

Create the test file, test suite, and test case structure.

tf = sltest.testmanager.TestFile("API Test File");
ts = createTestSuite(tf,"API Test Suite");
tc = createTestCase(ts,"baseline","Baseline API Test Case");

Remove the default test suite.

tsDel = getTestSuiteByName(tf,"New Test Suite 1");
remove(tsDel);

Assign the system under test to the test case.

setProperty(tc,"Model","sldemo_absbrake");

Capture the baseline criteria.

baseline = captureBaselineCriteria(tc,"baseline_API.mat",true);

Test a new model parameter by overriding it in the test case parameter set.

ps = addParameterSet(tc,"Name","API Parameter Set");
po = addParameterOverride(ps,"m",55);

Clear the Test Manager.

sltest.testmanager.clear
sltest.testmanager.clearResults
sltest.testmanager.close

Version History

Introduced in R2015b