Documentation

sltest.harness.set

Change test harness property

Syntax

sltest.harness.set(harnessOwner,harnessName,Name,Value)

Description

sltest.harness.set(harnessOwner,harnessName,Name,Value) changes a property, specified by one Name,Value pair argument, for the test harness harnessName owned by the model or component harnessOwner.

Examples

collapse all

Change the name of the test harness controller_harness, which is associated with the Controller subsystem in the f14 model. The new name is new_name.

f14;
sltest.harness.create('f14/Controller','Name','controller_harness');
sltest.harness.set('f14/Controller','controller_harness','Name','new_name')

Set the test harness controller_harness to allow editing of the component under test.

f14;
sltest.harness.create('f14/Controller','Name','controller_harness');
sltest.harness.set('f14/Controller','controller_harness',...
'EnableComponentEditing',true);

Input Arguments

collapse all

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 Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Name','updated_harness' specifies a new harness name 'updated_harness'.

collapse all

The new name for the harness, specified as the comma-separated pair consisting of 'Name' and a valid MATLAB filename.

Example:

'Name','new_harness_name'

The new description for the harness, specified by the comma-separated pair consisting of 'Description' and a character vector.

Example:

'Description','An updated test harness'

An option to specify when the component under test synchronizes between the main model and the test harness.

  • '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 the comma-separated pair consisting of 'UseDefaultName' and false or true.

Example:

'RebuildOnOpen',true

Option to have the configuration set and model workspace entries updated during test harness rebuild, specified as the comma-separated pair consisting of 'RebuildModelData' and true or false.

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 comma-separated pair 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 rebuild. For more information, see Customize Test Harnesses.

Example: 'PostRebuildCallback','HarnessCustomization'

Introduced in R2015a

Was this topic helpful?