report results of tests run with testmanager works from testmanager only

조회 수: 15 (최근 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

채택된 답변

Nick Mazzilli
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
Tobias Huth
Tobias Huth 2019년 12월 11일
Hey,
I do not understand why, but this fixed my issue indeed! Thank you very much!
Greetings from swabia,
Tobias

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jalaj Gambhir
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.
  댓글 수: 1
Tobias Huth
Tobias Huth 2019년 8월 30일
Hi,
thank you for your answer! I must have overseen the hint in the help document. I've tried it and it works if I alter the model to fail at least one test.
For me, it is still unclear why I can create a report on a model without failed tests from the toolstrip in the testmanager:SLTestman_repBtn.png
therefore I'm not going to accept the answer (yet).
Thanks again and regards,
Tobias

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Results, Reporting, and Test File Management에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by