How to customize the file name of the generated Simulink Coverage report (.html) from "sltest.te​stmanager.​report"?

조회 수: 4 (최근 30일)

Using "sltest.testmanager.report" function, I am generating Simulink Coverage reports (.html) for my test suite which includes model references. If I name the top level test report something like "TestReport.pdf", then a folder gets created called "TestReport" and HTML coverage reports are placed in the folder. These names of the generated reports are long alphanumerical strings. These names are non-specific and make it difficult to quickly trace which report corresponds to which model.
Is there a way to customize the name of these reports?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2025년 8월 28일 0:00
As of R2025a, there is no way to customize the name of Simulink Coverage HTML reports generated for Model References in a test suite when generated a Simulink Test report using the "sltest.testmanager.report" function. I have created an enhancement request to add this functionality to "sltest.testmanager.report" and our development team will consider changes in a future upgrade or release of MATLAB.
That being said, there is another way to create Simulink Coverage reports from Simulink Test results that does support custom naming of the HTML reports. The workaround is to use the "cvhtml" function directly. See below for an example script that demonstrates the usage of this function.
% Assuming tests are in "example.mldatx" >> exampleFile = 'example.mldatx'; % Run SL Tests >> sltest.testmanager.load(exampleFile); >> results = sltest.testmanager.run; % Extract coverage test case results >> tfr = results.getTestFileResults >> tsr = tfr.getTestSuiteResults >> tcr = tsr.getTestCaseResults % Create coverage report with customizable name/path >> cvhtml('testcase1_coverageresult.html', tcr.getCoverageResults)
For more information, please refer to this MathWorks documentation on the "cvhtml" function. 

추가 답변 (0개)

카테고리

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

제품


릴리스

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by