Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Verifier   

sldvmakeharness - Generate test harness model

Syntax

[status, savedHarnessFilePath] = sldvmakeharness
[status, savedHarnessFilePath] = sldvmakeharness(model)
[status, savedHarnessFilePath] = sldvmakeharness(model, sldvDataFile)
[status, savedHarnessFilePath] = sldvmakeharness(model, [], harnessFilePath)
[status, savedHarnessFilePath] = sldvmakeharness(model, [], [], modelRefHarness)

Description

[status, savedHarnessFilePath] = sldvmakeharness generates a test harness from the current Simulink model. If sldvmakeharness generates the test harness successfully, it returns status = 1. It also returns the path and file name for the generated harness model in savedHarnessFilePath. sldvmakeharness creates a harness model with no data; the harness includes one default test case that specifies default values for all input signals.

[status, savedHarnessFilePath] = sldvmakeharness(model) generates a test harness from model, which is a handle to a Simulink model or a string with the model name.

[status, savedHarnessFilePath] = sldvmakeharness(model, sldvDataFile) generates a test harness from the data file sldvDataFile. If the model name and data in sldvDataFile do not match the name and data of model, sldvmakeharness displays a warning, but it generates the harness and returns status = 1.

[status, savedHarnessFilePath] = sldvmakeharness(model, [], harnessFilePath) generates a test harness from model and stores it in harnessFilePath. If harnessFilePath is invalid, sldvmakeharness cannot save the harness, but it creates and opens it.

[status, savedHarnessFilePath] = sldvmakeharness(model, [], [], modelRefHarness) generates a test harness from model. If modelRefHarness is true, the test harness model includes model in a Model block. If modelRefHarness is false, the test harness model includes a copy of model.

Successful harness generation does not imply that the model is compatible with the Simulink Design Verifier software.

Examples

Create a test harness for the sldvdemo_cruise_control model:

[status, harnessfile] = sldvmakeharness('sldvdemo_cruise_control',...
      '', '', 'true');

Alternatives

sldvmakeharness creates a test harness model without analyzing the model:

  1. In the Model Editor, select Simulation > Configuration Parameters.

  2. In the Design Verifier Results pane, under Harness model options, set the options.

  3. Click OK.

  4. Select Tools > Design Verifier > Test Generation to run an analysis.

See Also

sldvharnessmerge | sldvrun

  


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