- Only top model coverage is reflected in the Cobertura XML
- Only model Decision coverage is reflected, and it is mapped to Condition elements in Cobertura XML
How Generate Code Coverage Report in Cobertura XML Format for a .slx file
7 views (last 30 days)
Show older comments
Diana
on 9 Jan 2024
Answered: Guilherme Costa Nascimento
on 9 Jan 2024
Hello,currently I work with Simulink Test for Model Unit Verification. For the last step - generating the reports (coverage, tests, requirements) I need to find a way to get all these in a XML or JSON or CSV format.
For the report generated out of the test manager I learned that I can use the XMLPlugin. So this is OK.
For the coverage report I saw there is the CodeCoveragePlugin -> CoberturaFormat, but this can be applied only on *.m files and *.mlx files.
Is there a way to apply use this plugin on *.slx files? or *.mldatx? Or is there any other plugin available for my case?
Also could you please help with the following 2 questions related to the coverage report:
1. Is there a way to generate this report only for a specific unit inside the Simulink model? My test harness is created at a higher level from the unit that I am interested to verify, so when I Run the Coverage, I get the report for the entire component.
Under Model Settings/Coverage view I have selected Subsystem and then I chose the unit that I am interested in, but no result. The coverage report is still created for the entire component.
2. From where can I chose to run only the Statement coverage?
Thank you!!!
0 Comments
Accepted Answer
Guilherme Costa Nascimento
on 9 Jan 2024
Hi Diana,
For Simulink models you can use the sltest.plugins.ModelCoveragePlugin. This documentation page has an example of how to do this: Model Coverage Results for Continuous Integration. Although the page is focused on continuous integration, the example works the same way when run on desktop.
Just note that the Cobertura format provides limited support to model coverage.
On your other two questions:
1. The model setting to scope the coverage results to only a particular subsystem only works when running coverage directly from Simulink. The option is not available in the Test Manager. You can use a coverage filter to exclude the components inside your harness that you do not want to include in the coverage results.
2. All code coverage metrics are computed when running a Simulink model in SIL or PIL mode. Do you need the report to only include Statement coverage?
0 Comments
More Answers (0)
See Also
Categories
Find more on Results, Reporting, and Test File Management in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!