sltest.harness.set
R2026bChange test harness property
Description
sltest.harness.set(
changes a property, specified by one
harnessOwner,harnessName,Name=Value)Name,Value pair argument, for the test
harness harnessName owned by the model or component
harnessOwner.
Examples
This example shows how to change the name of a test harness using sltest.harness.set.
Create a Test Harness
Load the sltestCruiseControl model and create a test harness for the CruiseControlMode subsystem.
load_system("sltestCruiseControl"); sltest.harness.create("sltestCruiseControl/CruiseControlMode");
Change the Test Harness Name
Change the name from the default sltestCruiseControl_Harness1 to CruiseCtrlHarness.
sltest.harness.set("sltestCruiseControl/CruiseControlMode",... 'sltestCruiseControl_Harness1',Name='CruiseCtrlHarness');
Input Arguments
Model or component handle, or path, specified as a character vector or double
Example: 1.9500e+03
Example: 'model_name'
Example: 'model_name/Subsystem'
The name of the harness, specified as a character vector.
Example: 'harness_name'
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: Name='updated_harness' specifies a new harness name
'updated_harness'.
The new name for the harness, specified as the name-value argument consisting of
Name and a valid MATLAB® filename.
Example: Name='new_harness_name'
The new description for the harness, specified by the name-value argument consisting of
Description and a character vector.
Example: Description='An updated test harness'
Option to specify when the component under test synchronizes the main model and the test harness. Subsystem model test harnesses are always synchronized with their underlying model.
"SyncOnOpenAndClose"rebuilds the component under test from the main model when the test harness opens, and pushes changes from the component under test to the main model when the test harness closes."SyncOnOpen"rebuilds the component under test from the main model when the test harness opens. It does not push changes from the component under test to the main model when the test harness closes."SyncOnPushRebuildOnly"rebuilds and pushes changes only when you manually initiate rebuild or push for the entire test harness.
For more information, see Synchronize Changes Between Test Harness and Model.
Example: SynchronizationMode="SyncOnOpen"
Option to have the harness rebuild when it opens, specified as numeric or logical
1 (true) or 0
(false).
Example: RebuildOnOpen=true
Option to have the configuration set and model workspace entries updated during test harness
rebuild, specified as numeric or logical 1 (true)
or 0 (false). This option is set to
true for Subsystem model test harnesses.
Example: RebuildModelData=true
Option to rebuild the harness without compiling the main model, in which cached information
from the most recent compile is used to update the test harness
workspace, and conversion subsystems are not updated, specified as the
name-value argument consisting of
RebuildWithoutCompile and true
or false.
Example: RebuildWithoutCompile=true
Use a post rebuild callback function to customize a test harness. The post rebuild callback function executes after the harness rebuilds. For more information, see Customize Test Harnesses.
Example: PostRebuildCallback='HarnessCustomization'
Name of the function interface to associate with the harness, specified as a string or character vector. This option applies only to reusable library components with function interfaces.
Example: FunctionInterfaceName='double_RLS'
Version History
Introduced in R2015a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)