Skip to Main Content Skip to Search
Product Documentation

Creating and Running Test Cases

To create and run test cases, model coverage provides two MATLAB commands, cvtest and cvsim. The cvtest command creates test cases that the cvsim command runs. (See Running Tests with cvsim.)

You can also run the coverage tool interactively:

  1. Open the sldemo_fuelsys model.

  2. In the Simulink model window, select Tools > Coverage Settings.

    The Coverage Settings dialog box Coverage tab appears.

  3. Select Coverage for this model: sldemo_fuelsys, which enables:

    • The Select Subsystem button

    • The metrics options in the Coverage metrics section

    • Fields on the Results, Reporting, and Options tabs of the Coverage Settings dialog box

  4. Under Coverage metrics, select the types of coverage that you want to record in the coverage report.

    For a complete description of all coverage options in the Coverage Settings dialog box, see Setting Model Coverage Options.

  5. Click OK.

  6. In the Simulink model window, select Start > Simulation or on the Simulink toolbar, click the Start button to start simulating the model.

    If you specify to report model coverage, the Simulink Verification and Validation software saves coverage data for the current run in the workspace object covdata and cumulative coverage data in covCumulativeData, by default. At the end of the simulation, this data appears in an HTML report that opens in a browser window.

      Note   You cannot run simulations if you select both model coverage reporting and acceleration options. If you select Accelerator mode in the model window, Simulink does not record coverage.

      You cannot select both block reduction and conditional branch input optimization when you perform coverage analysis because they interfere with coverage recording.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS