report results of tests run with testmanager works from testmanager only
14 次查看(过去 30 天)
显示 更早的评论
Hello everybody,
I've just installed simulink test and started to try things. Matlab and Simulink are 2019a.
I've authored tests in the testmanager, ran them and created a report from within the testmanager. This works like a charm.
When I try to repeat the steps described above via commands, which is:
>> test_cases = sltest.testmanager.load('BE_inject_testcases.mldatx');
>> test_results = sltest.testmanager.run()
test_results =
ResultSet with properties:
Name: 'Results: 2019-Aug-20 07:53:31'
NumPassed: 2
NumFailed: 0
NumDisabled: 0
NumIncomplete: 0
NumTotal: 2
NumTestCaseResults: 0
NumTestSuiteResults: 0
NumTestFileResults: 1
Outcome: Passed
StartTime: 20-Aug-2019 07:53:31
StopTime: 20-Aug-2019 07:53:37
Duration: 6 sec
CoverageResults: [1×2 cvdata]
Release: ''
alternatively:
test_results = sltest.testmanager.importResults('test_results_1.mldatx');
If I now call the report:
sltest.testmanager.report(test_results,'test_report.pdf','Author','author','Title','Titel','IncludeCoverageResult',true)
I get the following error:
Error using sltest.internal.TestResultReportBase/flatAndFilterReportData
No failed results selected.
Error in sltest.internal.TestResultReportBase/setReportGenerationEnviroment
Error in sltest.internal.TestResultReportBase/createReport
Error in stm.internal.report.createReport>processingArgs (line 140)
report.createReport();
Error in stm.internal.report.createReport (line 3)
processingArgs(inArgs)
Error in stm.internal.apiDetail.reportWrapper
Error in sltest.internal.report
Error in sltest.testmanager.report (line 73)
sltest.internal.report(resultObj, filePath, varargin{:});
Does someone know, what could be the cause of this behaviour?
Please not, that I do not have a report generator license.
Greetings from the sunny south of Germany,
Tobias
0 个评论
采纳的回答
Nick Mazzilli
2019-12-10
This should fix your issue
sltest.testmanager.report(test_results,'test_report.pdf','Author','author','Title','Titel','IncludeCoverageResult',true,'IncludeTestResults',0)
更多回答(1 个)
Jalaj Gambhir
2019-8-29
Hi,
It is stated in the MathWorks documentation that the report is only generated if the model has failed for at least one test case. This is mentioned here.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Test Scripts 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!