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.


Class: sltest.testmanager.TestFile
Package: sltest.testmanager

Convert test from one type to another




convertTestType(tf,testType) converts the test case type to a different type. The function converts all test cases contained in the test file. If you want to convert a single test case, then use the sltest.testmanager.TestCase.convertTestType method.

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 file that contains the test cases you want to convert to a different type, specified as a sltest.testmanager.TestFile 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


expand all

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

% Create new test case
tc2 = createTestCase(ts,'baseline','API Test Case');

% Convert test cases to simulation type


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

Introduced in R2016b