Main Content

copySimulationSettings

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

Copy simulation setting in equivalence test case

Syntax

copySimulationSettings(tc,fromSimIndex,toSimIndex)

Description

copySimulationSettings(tc,fromSimIndex,toSimIndex) copies the simulation setting from one simulation number to another within an equivalence test case. This function works only for equivalence test case types.

Input Arguments

expand all

Equivalence test case that you want to copy simulation settings in, specified as a sltest.testmanager.TestCase object.

Simulation number you want to copy the settings from, specified as an integer, 1 or 2. This is the source simulation.

Simulation number you want to copy the settings to, specified as an integer, 1 or 2. This is the target simulation.

Examples

expand all

% Open the model for this example
openExample('sldemo_absbrake');

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'equivalence','Equivalence Test Case');

% Remove the default test suite
tsDel = getTestSuiteByName(tf,'New Test Suite 1');
remove(tsDel);

% Assign the system under test to the test case
% for Simulation 1 and Simulation 2
setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',1);
setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',2);

% Change simulation stop time in Simulation 1
setProperty(tc,'StopTime',100,'SimulationIndex',1);

% Copy simulation setting to Simulation 2
copySimulationSettings(tc,1,2);

Version History

Introduced in R2015b