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.

copySimulationSettings

Class: sltest.testmanager.TestCase
Package: 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

% 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);

Introduced in R2015b