Generate harness model
generates a test harness from the
savedHarnessFilePath] = sldvmakeharness(
model, which is a handle to a
Simulink® model or the model name.
the path and file name of the generated harness model in
creates an empty harness model. The test harness includes one default test case that
specifies the default values for all input
If the software generates a harness, it does not imply that your model is compatible with the Simulink Design Verifier™ software.
Create a test harness for the
sldvdemo_cruise_control model by using the default
sldvdemo_cruise_control model by using the
default options and create a harness model:
open_system('sldvdemo_cruise_control'); harnessopts=sldvharnessopts(); [harnessfile] = sldvmakeharness('sldvdemo_cruise_control', '', harnessopts);
model— Name or handle of model
Handle to a Simulink model or the model name.
dataFile— Name of sldvData file
''(default) | character vector | string scalar
Name of the
harnessOpts— Configurations for sldvmakeharness
A structure whose fields specify these configurations for sldvmakeharness, as listed in this table.
Specifies the file path for creating the harness
model. If an invalid path is specified,
Generates the test harness model that includes
When set to
When set to
To create a default
harnessOpts object, use
savedHarnessFilePath— File name of generated harness model
The path and file name of the generated harness model.
sldvmakeharness creates a test harness
model without analyzing the model. To analyze the model and create
a test harness:
Open the model.
On the Design Verifier tab, in the Prepare section, from the drop-down menu for the mode settings, click Settings.
In the Configuration Parameters dialog box, on the Design Verifier > Results pane, in Harness model options, set the options that you want.
To perform test generation analysis, on the Design Verifier tab, in the Mode section, select Test Generation.
Click Generate Tests.