Main Content

captureEquivalenceCriteria

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

Capture equivalence criteria and add to test case

Syntax

eq = captureEquivalenceCriteria(tc,replaceAll)

Description

eq = captureEquivalenceCriteria(tc,replaceAll) runs the System Under Test in Simulation 1 and captures an equivalence criteria set. The function returns an equivalence criteria object, sltest.testmanager.EquivalenceCriteria. This function can be used only if the test type is an equivalence test case.

Input Arguments

expand all

Test case to capture equivalence criteria in, specified as an sltest.testmanager.TestCase object.

Replace existing equivalence criteria if criteria already exist in the test case, specified as a Boolean. true replaces existing criteria, and false produces an error if criteria already exist in the test case.

Output Arguments

expand all

Equivalence criteria added to the test case, returned as an sltest.testmanager.EquivalenceCriteria object.

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

% Capture equivalence criteria
eq = captureEquivalenceCriteria(tc);
Introduced in R2015b