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.

getIterations

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

Get test iterations that belong to test case

Syntax

iterArray = getIterations(tc)
iterArray = getIterations(tc,iterName)

Description

iterArray = getIterations(tc) get one or more test iteration objects that belong to the test case.

iterArray = getIterations(tc,iterName) get one or more test iteration objects with the specified name that belong to the test case.

Input Arguments

expand all

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

Test iteration name, specified as a character vector. This is an optional argument.

Example: 'Test Iteration 5'

Output Arguments

expand all

Test iterations that belong to the test case, returned as an array of sltest.testmanager.TestIteration objects.

Examples

expand all

% Create test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('Iterations Test File');
ts = getTestSuites(tf);
tc = createTestCase(ts,'simulation','Simulation Iterations');

% Specify model as system under test
setProperty(tc,'Model','sldemo_autotrans');
 
% Set up table iteration
% Create iteration object
testItr1 = sltestiteration;
% Set iteration settings
setTestParam(testItr1,'SignalBuilderGroup','Passing Maneuver');
% Add the iteration to test case
addIteration(tc,testItr1);

% Set up another table iteration
% Create iteration object
testItr2 = sltestiteration;
% Set iteration settings
setTestParam(testItr2,'SignalBuilderGroup','Coasting');
% Add the iteration to test case
addIteration(tc,testItr2);

% Get iterations
iters = getIterations(tc);

Introduced in R2016a