sltest.testmanager.Options 类
命名空间: sltest.testmanager
返回并指定测试文件选项
描述
获取 sltest.testmanager.Options
的实例以查看测试文件选项,包括报告生成选项。对于测试文件,您还可以设置选项。使用以下方式查看选项:
sltest.testmanager.Options
类是 handle
类。
创建对象
返回与测试用例、套件或文件相关的测试文件选项对象。obj
= getOptions(test
)
输入参量
测试用例、套件或文件,指定为 sltest.testmanager.TestCase
、sltest.testmanager.TestSuite
或 sltest.testmanager.TestFile
对象。
属性
报告的作者,指定为字符向量。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在测试结束时关闭图形的选项,指定为 true
以关闭图形,指定为 false
以保持图形打开。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
自定义报告生成类,指定为字符向量。有关信息,请参阅 自定义测试结果报告。
报告生成自定义模板文件的路径名,指定为字符向量。有关信息,请参阅 自定义测试结果报告。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在测试结束时生成报告的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在报告中包含仿真输出和基线的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在报告中包含覆盖率结果的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在报告中包含错误和日志消息的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在报告中包含从 MATLAB 代码生成的图形的选项,指定为 true
或 false
。将 MATLAB 代码指定为测试用例的自定义准则或测试用例、套件或文件的回调。您还必须将 SaveFigures
设置为 true
才能应用此设置。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在报告中包含您正在运行的 MATLAB 版本的选项,指定为 true
或 false
。
在报告中包含仿真元数据的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在报告中包含准则和评估图的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
报告页面上要包含的图的行数,指定为 1 至 4 之间的整数。仅当 IncludeSimulationSignalPlots
属性为 true
时才使用此属性。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
报告页面上要包含的图的列数,指定为 1 到 4 之间的整数。仅当 IncludeSimulationSignalPlots
属性为 true
时才使用此属性。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
在报告中包含测试需求的选项,指定为 true
或 false
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
报告中包含的测试结果,指定为 'failed'
、'passed'
或 'all'
。您也可以使用枚举值:
sltest.testmanager.TestResultsIncludedInReport.AllTests
sltest.testmanager.TestResultsIncludedInReport.FailedOnly
sltest.testmanager.TestResultsIncludedInReport.PassedOnly
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
报告的输出格式,指定为 'pdf'
、'zip'
或 'docx'
。您也可以使用枚举值:
sltest.testmanager.ReportFileFormat.doc
sltest.testmanager.ReportFileFormat.pdf
sltest.testmanager.ReportFileFormat.zip
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
保存报告的文件的路径名,指定为字符向量。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
将 MATLAB 图形与测试结果一起保存的选项,指定为 true
或 false
。如果您想在结果或报告中包含图,请将此选项设置为 true
。
属性:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
报告的标题,指定为字符向量。
属性:
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 Command
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 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)