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

4 views (last 30 days)

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?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 28 Aug 2025 at 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. 

More Answers (0)

Categories

Find more on Results, Reporting, and Test File Management in Help Center and File Exchange

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!