sltest.plugins.ModelCoveragePlugin Class
Namespace: sltest.plugins
Collect model coverage using the MATLAB Unit Test framework
Description
The sltest.plugins.ModelCoveragePlugin creates coverage reports and
allows setting coverage metrics for running Simulink®
Test™ and MATLAB®-based Simulink test cases with the MATLAB Unit Test framework. Set desired
sltest.plugins.ModelCoveragePlugin property values, and add the
instance of the sltest.plugins.ModelCoveragePlugin to the test
runner. To enable coverage collection, you must also add an instance of the sltest.plugins.MATLABTestCaseIntegrationPlugin to the test runner, or use
the addSimulinkTestResults method, which is another way to add the
sltest.plugins.MATLABTestCaseIntegrationPlugin.
For MATLAB-based Simulink tests, calls to the simulate
method collect coverage during the test run. These coverage results are available in the
Test Manager results. If you have a license for Parallel Computing Toolbox™, you can use the ModelCoveragePlugin with parallel test
execution.
Note
If you open a MATLAB -based Simulink test file in the Test Manager, enable coverage, and set the coverage
metrics, you do not need to use sltest.plugins.ModelCoveragePlugin.
However, if you use sltest.plugins.ModelCoveragePlugin and also set
coverage in the Test Manager, the Test Manager uses the settings in the
sltest.plugins.ModelCoveragePlugin object.
Creation
creates a model coverage plugin object mcp = sltest.plugins.ModelCoveragePlugin(Properties)mcp with specified
properties.
You can also import the plugin, then use the class name to create an instance of the plugin:
import sltest.plugins.ModelCoveragePlugin mcp = ModelCoveragePlugin(Properties)
Properties
Examples
Version History
Introduced in R2018a