This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Class: sltest.testmanager.TestCase
Package: sltest.testmanager

Add test iteration to test case




addIteration(tc,iter) adds a test iteration to the test case. The Test Manager gives the iteration a unique name.

addIteration(___,name) adds a test iteration to the test case with a specified name, which must be unique.

Input Arguments

expand all

Test case that you want to add the iteration to, specified as a sltest.testmanager.TestCase object.

Test iteration that you want to add to the test case, specified as a sltest.testmanager.TestIteration object.

Test iteration name, specified as a character vector. The name must be unique with respect to other iterations in the test case. This is an optional argument.

Example: 'Test Iteration 5'


expand all

In this example, there must be parameter sets defined in the Parameter Overrides section of the test case. The iterations are generated during test execution. This section of script is in the Scripted Iterations section of the test case. It will execute only in the Scripted Iterations section.

% Define parameter sets for a test case and add this code in the

% Scripted iterations section of the test case
for k = 1 : length(sltest_parameterSets)

    % Create test iteration object    
    testItr = sltest.testmanager.TestIteration();

    % Use the parameter set in this iteration
    testItr.setTestParam('ParameterSet', sltest_parameterSets{k});
    str = sprintf('ParameterSet %d', k);

    % Add the iteration object to the test case
    addIteration(sltest_testCase, testItr, str);

Introduced in R2016a