Main Content

sltest.testsequence.addStep

Add test sequence step

Description

sltest.testsequence.addStep(blockPath,stepPath,Name,Value)adds a step namedstepPathto aTest Sequenceblock specified byblockPath. Step properties are specified byName,Valuepairs.

Examples

collapse all

This example creates a test step in the Projector Fan Speed example test sequence under the parent stepSystemHeatingTest.

Set paths and open the model.

Model ='sltestProjectorFanSpeedExample'; Harness ='FanSpeedTestHarness'; open_system(Model);

Open the test harness.

sltest.harness.open(Model,Harness);

Create a new local variableh.

sltest.testsequence.addsymbol('FanSpeedTestHarness/Test Sequence',...'h','Data','Local');

Create a stepsubstep1under the stepSystemHeatingTestand assign the value5toh.

sltest.testsequence.addStep('FanSpeedTestHarness/Test Sequence',...'SystemHeatingTest.substep1','Action','h = 5')

Input Arguments

collapse all

Path to aTest Sequenceblock, including the block name, specified as a string or character vector.

Example:'FanSpeedTestHarness/Test Sequence'

Path of the step in theTest Sequenceblock, specified as a character vector. The path includes the step location in the Test Sequence hierarchy, using.to separate hierarchy levels. If the Test Sequence block is using scenarios, add the scenario name that contains the step to the beginning of the step path, for example,Scenario_2.SystemHeatingTest.InitializeHeating.

Example:'SystemHeatingTest.InitializeHeating'

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis 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 encloseNamein quotes.

Example:'Action','out = square(et)','IsWhenStep',false,'Description','Square wave.'specifies a test step to produce a square wave.

Test step action programming. To add a line, create the step actions using thesprintffunction and the new line operator,\n.

Example:'Action','out = square(et)'

Specifies whether the step is a standard transition type or a When decomposition transition.

Example:'IsWhenStep',true

Specifies the condition that activates aWhendecomposition child step. To activate theWhenstep, enter a valid logical expression.

Example:'WhenCondition','a >= 1'

Test step description, specified as a character vector.

Example:'Description','This step produces a high-frequency square wave.'

版本历史

Introduced in R2016a