Main Content

sltest.harness.move

Move test harness from linked instance to library block or to a different harness owner

Description

sltest.harness.move(HarnessOwner,HarnessName) moves the test harness HarnessName associated with the block HarnessOwner from the linked instance to its reference library block. Moving the test harness removes it from the linked instance. This command results in an error if HarnessName is not a linked instance.

sltest.harness.move(HarnessOwner,HarnessName,NewPath) moves the test harness harnessName associated with the block HarnessOwner to the destination path specified by NewPath.

sltest.harness.move(HarnessOwner,HarnessName,Name,Value) moves the test harness HarnessName associated with HarnessOwner using additional options specified by one or more Name, Value pairs.

Examples

collapse all

Move the test harness Baseline_controller_tests from the linked instance of the Controller subsystem to the library subsystem. Warnings display when you move a test harness.

% Open the model 
openExample("sltestHeatpumpLibraryLinkExample")
% Move the test harness
sltest.harness.move("sltestHeatpumpLibraryLinkExample/Controller",...
"Baseline_controller_tests")

Move the test harness Requirements_Tests from the linked instance of the Controller subsystem to the Plant subsystem and save it as Requirements_Tests_Moved.

sltest.harness.move...
   ("sltestHeatpumpLibraryLinkExample/Controller",...
   "Requirements_Tests","DestinationOwner",...
   "sltestHeatpumpLibraryLinkExample/Plant",...
   "Name","Requirements_Tests_Moved")

Input Arguments

collapse all

Model or component handle or path, specified as a character vector or a 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'

The destination path of the moved test harness, specified as a character vector.

Example: 'model_name/Subsystem2'

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'DestinationOwner','model3/Controller3','Name','newMovedHarness'

Owner block to which the test harness is moved, specified as the comma-separated pair consisting of 'DestinationOwner' and a character vector.

Example: 'DestinationOwner','model3/Controller3'

The name of the moved test harness, specified as the comma-separated pair consisting of 'Name' and a character vector. If a value is not specified for Name, the name of the test harness is used by default.

Example: 'Name','newMovedHarness'

Version History

Introduced in R2016a