文档Help Center文档
生成测试结果报告
sltest.testmanager.report(resultObj,filePath,Name,Value)
例子
sltest.testmanager.report(ResultObj,,,,filePath,,,,名称,价值)生成指定结果的报告ResultObjand saves the report to thefilePathlocation.
sltest.testmanager.report(ResultObj,,,,filePath,,,,名称,价值)
ResultObj
filePath
名称,价值
全部收缩
生成包括测试作者,测试标题和MATLAB的报告®版本用于运行测试用例。该报告仅包括失败的结果。
filepath ='test.pdf'; sltest.testmanager.report(resultObj,filePath,...'作者',,,,'TestAuthor',,,,...'Title',,,,'测试',,,,...“ includemlversion',真的,...'IncludeTestResults',2);
如果创建一个自定义类以自定义使用该报告的生成方式sltest.testmanager.TestResultReport类,然后使用以下方式生成报告
sltest.testmanager.TestResultReport
%导入现有结果或使用sltest.testmanager.run进行测试% and collect resultsresult = sltest.testmanager.importResults('testResults.mldatx'); filePath ='testreport.zip'; sltest.testmanager.report(result,filePath,...'作者',,,,'用户',,,,...'Title',,,,'测试',,,,...“ includemlversion',真的,...'IncludeTestResults',int32(0),...'IncludeSimulationSignalPlots',真的,...“ numplotcolumnsperpage”,,,,2,,,,...“ CustomReportClass”,,,,'CustomReport',,,,...“启动报告”,真的);
结果设置对象to get results from, specified as ansltest.testmanager.resultset目的。
sltest.testmanager.resultset
生成报告的文件名和路径,指定为字符向量。文件路径必须具有PDF,DOCX或ZIP的文件扩展,这是唯一受支持的文件类型。金宝app
指定可选的逗号分隔对名称,价值arguments.姓名是参数名称和Valueis the corresponding value.姓名必须出现在引号中。您可以按任何顺序指定几个名称和值对参数姓名1,,,,Value1,...,NameN,ValueN。
姓名
Value
姓名1,,,,Value1,...,NameN,ValueN
“ includeTeStrequirement',真实
作者
报告作者的名称,指定为字符向量。
Example:“测试工程师”
“测试工程师”
标题
'测试'
报告的标题,指定为字符向量。
Example:'Test_Report_1'
'Test_Report_1'
IncludeMLVersion
true
错误的
Choose to include the version of MATLAB used to run the test cases, specified as a Boolean value,trueor错误的。
IncludeTestRequirement
选择包括在下定义的测试要求链接Requirementsin the test case, specified as a Boolean value,trueor错误的。
包括模拟信号
Choose to include the simulation output plots of each signal, specified as a Boolean value,trueor错误的。
numplotrowsperpage
在报告页面上包括的行数,,,,specified as an integer from 1 to 4. This property is used only if the包括模拟信号property istrue。
numplotcolumnsperpage
Number of columns of plots to include on report pages, specified as an integer from 1 to 4. This property is used only if the包括模拟信号property istrue。
包含parsonsignAlplots
选择在基线标准,等效标准或使用该评估的评估中包括信号比较图verify测试案例中的操作员,指定为布尔值,trueor错误的。
verify
IncludeMATLABFigures
选项包括从回调脚本,自定义标准或报告中的模型打开的数字,指定为trueor错误的。
包括越野赛
Choose to include error messages from the test case simulations, specified as a Boolean value,trueor错误的。
IncludeTestResults
2
0
1
选项包括全部或部分测试结果in the report. You can select passed and failed results, specified as the integer value0,选择仅通过的结果,指定为值1,或仅选择失败的结果,指定为值2。
LaunchReport
报告完成时打开该报告,将其指定为布尔值,trueor to not open the report,错误的。
CustomTemplateFile
姓名and path for a微软®单词用于报告生成的模板文件,指定为字符向量。这是一个可选的参数,只有在您有一个时才可用MATLAB报告Generator™执照。
CustomReportClass
用于报告自定义的类的名称,指定为字符向量。这是一个可选的参数,只有在您有一个时才可用MATLAB报告生成器执照。
包括coverageresult
选择包括在测试执行时收集的覆盖范围指标,指定为布尔值,trueor错误的。有关收集覆盖范围的更多信息,请参阅在测试中收集覆盖范围。
包括模拟Mettadata
选择为每个测试案例或迭代包含模拟元数据,指定为布尔值,trueor错误的。元数据包括:simulink金宝app®version, model version, model author, date, model user ID, model path, machine name, solver name, solver type, fixed step size, simulation start time, simulation stop time, and platform.
sltest.testmanager.resultset|sltest.testmanager.TestResultReport
您单击了与此MATLAB命令相对应的链接:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。金宝app
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
联系您当地的办公室