MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看最新英文版本。
从模型生成测试用例
testFile = sltest.testmanager.createTestsFromModel(filePath,modelName,testType)
testFile = sltest.testmanager.createTestsFromModel(filePath,modelName,testType) 根据模型结构体生成测试用例。该功能从模型中的测试框架和信号编辑器场景创建测试用例并将它们分配给测试文件。
testFile
filePath
modelName
testType
示例
全部折叠
在测试管理器中创建一个包含新测试用例的新测试文件。每个测试用例使用一个信号编辑器场景。
% Open the model for this example openExample('sldemo_autotrans'); testFile = sltest.testmanager.createTestsFromModel... ('C:\MATLAB\TestFile.mldatx','sldemo_autotrans','baseline')
testFile = TestFile with properties: Name: 'TestFile' FilePath: 'C:\MATLAB\TestFile.mldatx' Dirty: 0
保存生成的测试用例文件的路径和名称,指定为字符向量。
示例: 'C:\MATLAB\TestFile.mldatx'
'C:\MATLAB\TestFile.mldatx'
生成测试用例的模型的名称,指定为字符向量。
示例: 'mymodel'
'mymodel'
'baseline'
'simulation'
'equivalence'
要生成的测试用例的类型,指定为字符向量。该函数使用此测试用例类型创建测试用例。
sltest.testmanager.TestFile
包含生成的测试用例的测试文件,以 sltest.testmanager.TestFile 对象的形式返回。
在 R2015b 中推出
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处