Main Content

convertTestType

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

Convert test from one type to another

Syntax

convertTestType(tc,testType)

Description

convertTestType(tc,testType) converts the test case type to a different type.

If you convert certain test case types to another type, then you can lose information about the original test case:

  • Baseline to simulation or equivalence — baseline criteria is lost

  • Equivalence to simulation or baseline — equivalence criteria is lost for Simulation 1 and 2

Input Arguments

expand all

Test case that you want to convert to a different type, specified as a sltest.testmanager.TestCase object.

Test case type that you want to convert to, specified as a sltest.testmanager.TestCaseTypes enumeration. Specify:

  • sltest.testmanager.TestCaseTypes.Baseline to convert to a baseline test case

  • sltest.testmanager.TestCaseTypes.Equivalence to convert to an equivalence test case

  • sltest.testmanager.TestCaseTypes.Simulation to convert to a simulation test case

Examples

expand all

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

% Create new test file with test suite and default test case
tf = sltest.testmanager.TestFile('API Test File');
ts = getTestSuites(tf);
tc = getTestCases(ts);

% Assign system under test to test case
setProperty(tc,'Model','sldemo_absbrake');

% Convert test case to simulation type
convertTestType(tc,sltest.testmanager.TestCaseTypes.Simulation);

Alternatives

You can also convert the test case type using the context menu in the Test Browser pane. Right-click the test case, select Convert to, and then select the test case type you want to convert the test case to.

Version History

Introduced in R2016b