sltest.testmanager.copyTests
将测试用例或测试套件复制到另一个位置
说明
将测试用例或测试套件复制到另一个测试文件或测试套件。objArray
= sltest.testmanager.copyTests(srcObjArray
,targetObj
)
示例
将测试用例复制到新的测试套件
% Create test structure tf = sltest.testmanager.TestFile('Test File'); ts_orig = tf.createTestSuite('Original Test Suite'); tc1 = ts_orig.createTestCase('baseline','Baseline Test Case 1'); tc2 = ts_orig.createTestCase('baseline','Baseline Test Case 2'); % Create new test suite for the target location ts_new = tf.createTestSuite('New Test Suite'); % Copy test cases to new test suite objArray = sltest.testmanager.copyTests([tc1,tc2],ts_new)
objArray = 1x2 TestCase array with properties: Name Description Enabled ReasonForDisabling TestFile TestPath TestType Parent
输入参数
srcObjArray
— 要复制的测试用例或测试套件
对象数组
要复制的测试用例或测试套件,指定为 sltest.testmanager.TestCase
或 sltest.testmanager.TestSuite
对象的数组。
targetObj
— 目标测试文件或测试套件
对象
要复制到的目标测试文件或测试套件,指定为 sltest.testmanager.TestFile
或 sltest.testmanager.TestSuite
对象。
输出参量
objArray
— 新位置的测试用例或测试套件
对象数组
目标位置的测试用例或测试套件,以 sltest.testmanager.TestCase
或 sltest.testmanager.TestSuite
对象数组的形式返回。
版本历史记录
在 R2015b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)