Main Content

sltest.testmanager.report

生成测试结果报告

描述

例子

sltest.testmanager.report(ResultObj,,,,filePath,,,,名称,价值生成指定结果的报告ResultObjand saves the report to thefilePathlocation.

例子

全部收缩

生成包括测试作者,测试标题和MATLAB的报告®版本用于运行测试用例。该报告仅包括失败的结果。

filepath ='test.pdf'; sltest.testmanager.report(resultObj,filePath,...'作者',,,,'TestAuthor',,,,...'Title',,,,'测试',,,,...“ includemlversion',真的,...'IncludeTestResults',2);

如果创建一个自定义类以自定义使用该报告的生成方式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目的。

生成报告的文件名和路径,指定为字符向量。文件路径必须具有PDF,DOCX或ZIP的文件扩展,这是唯一受支持的文件类型。金宝app

名称值参数

指定可选的逗号分隔对名称,价值arguments.姓名是参数名称和Valueis the corresponding value.姓名必须出现在引号中。您可以按任何顺序指定几个名称和值对参数姓名1,,,,Value1,...,NameN,ValueN

Example:“ includeTeStrequirement',真实

报告作者的名称,指定为字符向量。

Example:“测试工程师”

报告的标题,指定为字符向量。

Example:'Test_Report_1'

Choose to include the version of MATLAB used to run the test cases, specified as a Boolean value,trueor错误的

选择包括在下定义的测试要求链接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错误的

在报告页面上包括的行数,,,,specified as an integer from 1 to 4. This property is used only if the包括模拟信号property istrue

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

选择在基线标准,等效标准或使用该评估的评估中包括信号比较图verify测试案例中的操作员,指定为布尔值,trueor错误的

选项包括从回调脚本,自定义标准或报告中的模型打开的数字,指定为trueor错误的

Choose to include error messages from the test case simulations, specified as a Boolean value,trueor错误的

选项包括全部或部分测试结果in the report. You can select passed and failed results, specified as the integer value0,选择仅通过的结果,指定为值1,或仅选择失败的结果,指定为值2

报告完成时打开该报告,将其指定为布尔值,trueor to not open the report,错误的

姓名and path for a微软®单词用于报告生成的模板文件,指定为字符向量。这是一个可选的参数,只有在您有一个时才可用MATLAB报告Generator™执照。

用于报告自定义的类的名称,指定为字符向量。这是一个可选的参数,只有在您有一个时才可用MATLAB报告生成器执照。

选择包括在测试执行时收集的覆盖范围指标,指定为布尔值,trueor错误的。有关收集覆盖范围的更多信息,请参阅在测试中收集覆盖范围

选择为每个测试案例或迭代包含模拟元数据,指定为布尔值,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.

Introduced in R2015a