Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Verifier   

sldv.test - Test objective

Syntax

sldv.test(expr)

Description

sldv.test(expr) Specifies that expr should be made true when generating tests. Use any valid Boolean Embedded MATLAB expression for expr.

This function has no output and no impact on its parenting function, other than any indirect side effects of evaluating expr. If you issue this function from the MATLAB command line, the function has no effect.

Intersperse sldv.test test objectives within Embedded MATLAB code or separate the objectives into a verification script.

The Test objectives option in the Test generation pane applies to test objectives represented with the sldv.test function, as well as with the Test Objective block.

Examples

Add a test objective and test conditions, using Embedded MATLAB expressions.

  1. Open the sldvdemo_cruise_control model and save it as my_sldvdemo_cruise_control.

  2. Remove the Test Condition block for the speed block signal. Instead of the Test Condition block, this example uses sldv.test and sldv.condition.

  3. From the User-Defined Functions library, add an Embedded MATLAB Function block and:

    1. Name the block "tests."

    2. Connect the block to the signal for the speed block and to the signal for the target block.

  4. Add the following code to the tests Embedded MATLAB Function block.

  5. In the Embedded MATLAB editor, save the updated code.

  6. Generate the test: select Tools > Design Verifier > Generate Tests.

Alternatives

Instead of using the sldv.test function, you can insert a Test Objective block in your model.

However, using sldv.test instead of a Test Objective block offers several benefits, described in About Test Case Generation.

See Also

Proof Assumption | Proof Objective | sldv.assume | sldv.condition | sldv.prove | Test Condition | Test Objective

Tutorials

How To

  


Related Products & Applications

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

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