Main Content

deleteIterations

Class: sltest.testmanager.TestCase
Namespace: sltest.testmanager

Delete test iterations that belong to test case

Syntax

deleteIterations(tc,iter)

Description

deleteIterations(tc,iter) deletes one or more test iterations from the test case.

Input Arguments

expand all

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

Test iterations that you want to delete from the test case, specified as an array of sltest.testmanager.TestIteration objects.

Examples

expand all

Load the model for this example.

load_system("sf_car")

Clear previous test files and results from the Simulink Test Manager.

sltest.testmanager.clear
sltest.testmanager.clearResults

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

tf = sltest.testmanager.TestFile("Iterations Test File");
ts = sltest.testmanager.TestSuite(tf,"Iterations Test Suite");
tc = createTestCase(ts,simulation="Simulation Iterations");

Remove default test suite and its test case.

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

Specify the model as the system under test.

setProperty(tc,Model="sf_car");

Set up a table iteration and create an iteration object. Then set the iteration settings and add the iteration to the test case.

testItr1 = sltestiteration;
setTestParam(testItr1,SignalEditorScenario="Passing_Maneuver");
addIteration(tc,testItr1);

Set up another table iteration, iteration object, iteration settings, and add the iteration to the test case.

testItr2 = sltestiteration;
setTestParam(testItr2,SignalEditorScenario="Coasting");
addIteration(tc,testItr2);

Delete the first iteration.

deleteIterations(tc,testItr1);

Version History

Introduced in R2016a