sltest.testmanager.TestIteration Class
Namespace: sltest.testmanager
Create or modify test iteration
Description
Iterations let you test a combination of model settings for testing methods such as Monte Carlo and parameter sweeping. Iterations initialize during test execution but before model callbacks and test callbacks. Once you create a test iteration object, you can override aspects of the test case for each iteration using the class methods.
You create your iteration script in the text window under the Iterations section of a test case. Iteration scripts cannot run in the MATLAB® command window.
The examples scripts in this reference page must be inserted into this section and other sections of the test case must be defined. When executing your test, scripted iterations run before the model is loaded. For more information on iterations and scripted iterations, see Test Iterations.
The sltest.testmanager.TestIteration
class is a handle
class.
Creation
returns a test iteration object. The object is used to construct a single iteration in a
test case. Each iteration you want to create in the test must use a single iteration
object.iterationObj
= sltest.testmanager.TestIteration
You can also create a test iteration within an iteration script using the
sltestiteration
function.
If you use a for
loop in the MATLAB command window to add many iterations to a test case, then the MATLAB command window might become temporarily unusable. Instead, use
vectorization in the command window to add iterations to a test case. For
example:
iterations(100) = sltest.testmanager.TestIteration; addIteration(tc,iterations);
Properties
Methods
Examples
Alternatives
If you do not want to use a script to create iterations, then you can use table iterations in the test case. For more information about table iterations, see Test Iterations.
Version History
Introduced in R2016a