sltest.testmanager.Options 类
命名空间: sltest.testmanager
返回并指定测试文件选项
描述
获取 sltest.testmanager.Options
的实例以查看测试文件选项,包括报告生成选项。对于测试文件,您还可以设置选项。使用以下方式查看选项:
sltest.testmanager.Options
类是 handle
类。
创建对象
返回与测试用例、套件或文件相关的测试文件选项对象。obj
= getOptions(test
)
输入参量
test
— 测试用例、套件或文件
sltest.testmanager.TestCase
对象 | sltest.testmanager.TestSuite
对象 | sltest.testmanager.TestFile
对象
测试用例、套件或文件,指定为 sltest.testmanager.TestCase
、sltest.testmanager.TestSuite
或 sltest.testmanager.TestFile
对象。
属性
Author
— 报告作者
字符向量
报告的作者,指定为字符向量。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
CloseFigures
— 测试结束时关闭图形的选项
true
(默认) | false
在测试结束时关闭图形的选项,指定为 true
以关闭图形,指定为 false
以保持图形打开。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
CustomReportClass
— 自定义报告生成类
字符向量
自定义报告生成类,指定为字符向量。有关信息,请参阅 自定义测试结果报告。
CustomTemplateFile
— 报告生成自定义模板文件的路径名
字符向量
报告生成自定义模板文件的路径名,指定为字符向量。有关信息,请参阅 自定义测试结果报告。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
GenerateReport
— 在测试结束时生成报告的选项
false
(默认) | true
在测试结束时生成报告的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeComparisonSignalPlots
— 在报告中包含仿真输出和基线的选项
true
(默认) | false
在报告中包含仿真输出和基线的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeCoverageResult
— 选择在报告中包含覆盖率结果
false
(默认) | true
在报告中包含覆盖率结果的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeErrorMessage
— 在报告中包含错误和日志消息的选项
true
(默认) | false
在报告中包含错误和日志消息的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeMATLABFigures
— 在报告中包含由 MATLAB® 代码生成的图表的选项
false
(默认) | true
选择在报告中包含从 MATLAB 代码生成的图形,指定为 true
或 false
。将 MATLAB 代码指定为测试用例的自定义准则或测试用例、套件或文件的回调。您还必须将 SaveFigures
设置为 true
才能应用此设置。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeMLVersion
— 在报告中包含 MATLAB 版本的选项
true
(默认) | false
选择在报告中包含您正在运行的 MATLAB 版本,指定为 true
或 false
。
IncludeSimulationMetadata
— 在报告中包含仿真元数据的选项
false
(默认) | true
在报告中包含仿真元数据的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeSimulationSignalPlots
— 选择在报告中包含准则和评估图
false
(默认) | true
在报告中包含准则和评估图的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
NumPlotRowsPerPage
— 报告页面上要包含的图表行数
2 (默认)
报告页面上要包含的图的行数,指定为 1 至 4 之间的整数。仅当 IncludeSimulationSignalPlots
属性为 true
时才使用此属性。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
NumPlotColumnsPerPage
— 报告页面上包含的图表列数
1 (默认)
报告页面上要包含的图的列数,指定为 1 到 4 之间的整数。仅当 IncludeSimulationSignalPlots
属性为 true
时才使用此属性。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeTestRequirement
— 选择在报告中包含测试需求
true
(默认) | false
在报告中包含测试需求的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
IncludeTestResults
— 报告中要包含的测试结果
'failed'
(默认) |'passed'
| 'all'
| 枚举的 sltest.testmanager.TestResultsIncludedInReport
值
报告中包含的测试结果,指定为 'failed'
、'passed'
或 'all'
。您也可以使用枚举值:
sltest.testmanager.TestResultsIncludedInReport.AllTests
sltest.testmanager.TestResultsIncludedInReport.FailedOnly
sltest.testmanager.TestResultsIncludedInReport.PassedOnly
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
ReportFormat
— 报告输出格式
'pdf'
(默认)| 'zip'
| 'doc'
| 枚举的 sltest.testmanager.ReportFileFormat
值
报告的输出格式,指定为 'pdf'
、'zip'
或 'docx'
。您也可以使用枚举值:
sltest.testmanager.ReportFileFormat.doc
sltest.testmanager.ReportFileFormat.pdf
sltest.testmanager.ReportFileFormat.zip
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
ReportPath
— 保存报告的文件路径名
字符向量
保存报告的文件的路径名,指定为字符向量。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
SaveFigures
— 选择将 MATLAB 图形与测试结果一起保存
false
(默认) | true
选择将 MATLAB 图形与测试结果一起保存,指定为 true
或 false
。如果您想在结果或报告中包含图表,请将此选项设置为 true
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Title
— 报告标题
字符向量
报告的标题,指定为字符向量。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
示例
获取和设置测试文件选项
创建测试文件、测试套件和测试用例结构体。
tf = sltest.testmanager.TestFile('API Test File'); ts = createTestSuite(tf,'API Test Suite'); tc = createTestCase(ts,'baseline','Baseline API Test Case');
获取测试文件选项。
opt = getOptions(tf);
设置报告标题,保存图表,每页包含 3 行图表。每页列数默认为 2。
opt.Title = 'ABC Co. Test Results';
opt.SaveFigures = true;
opt.IncludeSimulationSignalPlots = true;
opt.NumPlotRowsPerPage = 3;
版本历史记录
在 R2017a 中推出
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)