sltest.testmanager.TestSuite 类
命名空间: sltest.testmanager
创建或修改测试套件
描述
sltest.testmanager.TestSuite
的实例可以包含其他测试套件和测试用例。对于基于 MATLAB® 的 Simulink® 测试,测试套件是使用类和方法参数实现的。查看 使用基于 MATLAB 的 Simulink 测试的测试模型 以了解更多信息。
sltest.testmanager.TestSuite
类是 handle
类。
创建对象
描述
创建一个具有指定 Name 的 obj
= sltest.testmanager.TestSuite(parent
,name
)sltest.testmanager.TestSuite
对象作为指定 Parent 的子对象。您可以使用测试文件或其他测试套件作为父级。
属性
Parent
— 父测试文件或测试套件
对象
作为指定测试套件的父级的测试文件或测试套件,指定为 sltest.testmanager.TestFile
或 sltest.testmanager.TestSuite
对象。
属性:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
数据类型:
Name
— 测试套件名称
字符向量
不包含文件路径和文件扩展名的测试文件的名称,以字符向量形式返回。
属性:
GetAccess | public |
SetAccess | public |
Dependent | true |
NonCopyable | true |
数据类型:
Description
— 测试套件描述
字符向量
测试套件描述文本,指定为字符向量。
属性:
GetAccess | public |
SetAccess | public |
Dependent | true |
NonCopyable | true |
数据类型: char
Enabled
— 测试套件执行指标
true
(默认) | false
指示测试套件的子测试用例是否执行,指定为逻辑值 true
或 false
。
属性:
GetAccess | public |
SetAccess | public |
Dependent | true |
NonCopyable | true |
数据类型: logical
ReasonForDisabling
— 已禁用描述
字符向量
测试套件被禁用的原因的描述文本,指定为字符向量。仅当 Enabled
属性设置为 false
时,此属性才可见。
属性:
GetAccess | public |
SetAccess | public |
Dependent | true |
NonCopyable | true |
数据类型: char
Requirements
— 测试套件需求
结构体数组
附加在测试套件级别的需求,以结构体返回。
属性:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
数据类型: struct
Tags
— 分类标签
字符向量 | 字符串数组
用于分类的标签,指定为字符向量或字符串数组。
属性:
GetAccess | public |
SetAccess | public |
Dependent | true |
NonCopyable | true |
数据类型: char
| string
TestFile
— 父测试文件
sltest.testmanager.TestFile
对象
作为测试套件的父级的测试文件,以 sltest.testmanager.TestFile
对象的形式返回。
属性:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
数据类型: object
TestPath
— 测试层次
字符向量
测试文件和测试套件层次结构,以字符向量形式返回。
属性:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
数据类型: char
方法
公共方法
convertTestType | 将测试从一种类型转换为另一种类型 |
createTestCase | 创建测试用例 |
createTestSuite | 创建测试套件 |
getCoverageSettings | 获取覆盖率设置 |
getOptions | 获取测试文件选项 |
getProperty | 获取测试套件属性 |
getTestCaseByName | 通过名称获取测试用例对象 |
getTestCases | 获取第一级测试套件的测试用例 |
getTestSuiteByName | 通过名称获取测试套件对象 |
getTestSuites | 获取测试套件第一级的测试套件 |
remove | 删除测试套件 |
run | 在测试套件中运行测试用例 |
setProperty | 设置测试套件属性 |
示例
创建新的测试文件和套件
% Create test file testfile = sltest.testmanager.TestFile('C:\MATLAB\test_file.mldatx'); % Create test suite testsuite = sltest.testmanager.TestSuite(testfile,'My Test Suite')
testsuite = TestSuite with properties: Name: 'My Test Suite' TestFile: [1x1 sltest.testmanager.TestFile] TestPath: 'test_file > My Test Suite' Parent: [1x1 sltest.testmanager.TestFile] Requirements: [0x1 struct] Description: '' Enabled: 1
版本历史记录
在 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)