Main Content

Test Manager

Model and code testing in different execution environments, manage test suites, and analyze and report results

Description

You can use theTest Managerto create test cases for Simulink®models and code in desktop, SIL, PIL, and HIL (for target computers runningSimulink Real-Time™) execution environments. You can create or import test data, run tests, view results, and create reports. You can also import and test C and C++ code, and MATLAB®test scripts.

You can group test cases into test suites, which are saved in a test file. The types of test you can create are simulation tests, equivalence (back-to-back) tests to compare models or generated code, and baseline tests to compare model output to a known baseline. You can run tests directly on your model or use test harnesses, which keep the test environment separate from your model. SeeTest Harness and Model Relationship.

You can specify the model or component to test, as well as:

  • Test inputs

  • Test outputs, such as logged signals and states

  • Baseline criteria for baseline tests

  • Iterations to run different combinations of inputs, parameters, baseline criteria, etc.

  • Temporal and logical assessments of simulation behavior

  • Model parameter and configuration overrides

  • Callbacks to run before and after loading the model

  • Coverage settings to measure the extent to which model or code execution paths are exercised

  • Link requirements to the tests that verify them

Note

If your model or test harness contains aTo Workspaceblock, the block variable is not saved in the base workspace after the test finishes running. Upon test completion, the base workspace is restored to its original state.

Open the Test Manager

  • In the Simulink toolstrip

    1. Open theAppstab.

    2. In the Model Verification, Validation, and Test section, clickSimulink Test.

    3. On theTeststab, clickSimulink Test Manageron the Tests toolstrip.

  • At the MATLAB command prompt, entersltest.testmanager.view.

In the Test Manager, the test sections in theTest Browserpane contain the options for the test. For descriptions of the options, see指定测试属性的测试经理.

By default, running a test in the Test Manager disables breakpoints for Simulink, Stateflow®, andTest Sequenceblocks. UseRun with Stepperin the Test Manager to run a test in the simulation stepper and use the breakpoints there.

Version History

Introduced in R2015a