Main Content

sltestiteration

Create test iteration

Description

iterObj = sltestiteration returns a test iteration object, sltest.testmanager.TestIteration. You can use the function in the MATLAB® command window, or you can use it in the context of a scripted iteration under the Iterations section of a test case. For more information on creating test iterations, see Test Iterations.

example

Examples

collapse all

This example is a script that you enter in the Scripted Iterations script text box in the Iterations section of a test case. Also, the system under test for this example is a model that contains Signal Editor scenarios.

% Determine the number of possible iterations
numSteps = length(sltest_signalEditorScenarios);
 
% Create each iteration
for k = 1 : numSteps
    % Set up a new iteration object
    testItr = sltestiteration;
 
    % Set iteration settings
    setTestParam(testItr,'SignalEditorScenario',...
      sltest_signalEditorScenarios{k});
 
    % Add the iteration to run in this test case
    % You can pass in an optional iteration name
    addIteration(sltest_testCase,testItr);
end

Output Arguments

collapse all

Test iteration, returned as a sltest.testmanager.TestIteration object.

Version History

Introduced in R2016a