Class: sltest.testmanager.TestCase
Package: sltest.testmanager
Set test case property
setProperty(tc,Name,Value)
setProperty(
sets
a test case property.tc
,Name,Value
)
tc
— Test casesltest.testmanager.TestCase
objectTest case to set property, specified as an sltest.testmanager.TestCase
object.
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
'StopTime',100
'Model'
— System Under Test model nameThe model name in the System Under Test section, specified as a character vector.
Example: 'sldemo_absbrake'
'SimulationMode'
— Simulation mode'Normal'
| 'Accelerator'
| 'Rapid Accelerator'
| 'Software-in-the-Loop (SIL)'
| 'Processor-in-the-Loop (PIL)'
The simulation mode of the model or harness, specified as a
character vector. To return to the default model settings, specify
an empty character vector, ''
.
Example: 'SimulationMode','Rapid Accelerator'
'OverrideSILPILMode'
— Override SIL or PIL modefalse
(default) | true
Override SIL/PIL simulation mode of model blocks to Normal simulation
mode, specified as a logical. If this property is
true
, the associated check box in the Simulation
Settings Overrides section of the Test Manager is selected.
'OverrideStartTime'
— Override model start timefalse
(default) | true
Indicate if the test case overrides the model start time, specified as true
or false
.
'StartTime'
— Model start time0
(default) | scalarModel start time, specified as a scalar value.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
'OverrideStopTime'
— Override model stop timefalse
(default) | true
Indicate if the test case overrides the model stop time, specified as true
or false
.
'StopTime'
— Model stop time10
(default) | scalarModel stop time, specified as a scalar value.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
'OverrideInitialState'
— Override model initial statefalse
(default) | true
Indicate if the test case overrides the model initial state, specified as
true
or false
.
'InitialState'
— Model initial stateModel initial state from a workspace variable, specified as a character vector.
'HarnessName'
— Test harness nameName of a test harness to use in the System Under Test section, specified as a character vector.
'HarnessOwner'
— Test harness owner nameName of the test harness owner, specified as a character vector.
'UseSignalBuilderGroup'
— Override Signal Builder groupfalse
(default) | true
Indicate if the test case overrides the model and uses a different Signal Builder group in the
Inputs section, specified as true
or
false
.
'SignalBuilderGroup'
— Signal Builder group nameSignal Builder group name, specified as a character vector.
To return to the default model settings, specify an empty character
vector, ''
.
'OverrideModelOutputSettings'
— Override model output settingsfalse
(default) | true
Indicate if the test case overrides the model settings under the Outputs section, specified as
true
or false
.
'SaveOutput'
— Override saving outputfalse
(default) | true
Indicate if the test case overrides saving model output, specified as true
or false
.
'SaveState'
— Save output state valuesfalse
(default) | true
Indicate if the test case is set to save output state values, specified as
true
or false
.
'SignalLogging'
— Log signalstrue
(default) | false
Indicate if the test case is set to log signals marked for logging in the model, specified as
true
or false
.
'DSMLogging'
— Log Data Store variablestrue
(default) | false
Indicate if the test case is set to log Data Store variables, specified as
true
or false
.
'SaveFinalState'
— Save final statefalse
(default) | true
Indicate if the test case is set to store final state values, specified as
true
or false
.
'SimulationIndex'
— Equivalence test case simulation1
(default) | 2
Simulation number that the property applies to, specified as
an integer, 1
or 2
. This setting
applies to the simulation test case.
'ConfigSetOverrideSetting'
— Configuration setting override1
(default) | 2
| 3
Override the configuration settings, specified as an integer.
1
— No override
2
— Use a named configuration
set in the model
3
— Use a configuration
set specified in a file
'ConfigSetName'
— Configuration set nameName of the configuration setting in a model, specified as a character vector.
'ConfigSetVarName'
— Configuration set variable nameVariable name in a configuration set file, specified as a character vector.
'ConfigSetFileLocation'
— Configuration set file pathFile name and path of the configuration set, specified as a character vector.
'PreloadCallback'
— Pre-load callback scriptPre-load callback script, specified as a character vector.
'PostloadCallback'
— Post-load callback scriptPost-load callback script, specified as a character vector.
'CleanupCallback'
— Cleanup callback scriptTest-case level cleanup callback script, specified as a character vector. The function deletes any existing callback script and replaces it with the specified character vector.
Example: 'clear a % clear value from workspace'
'PreStartRealTimeApplicationCallback'
— Real-time pre-start callbackCharacter vector evaluated before the real-time application is started on the target computer, specified as a character vector. For more information on real-time testing, see Test Models in Real Time.
'IterationScript'
— Iteration scriptIteration script evaluated to create test case iterations, specified as a character vector. For more information about test iteration scripts, see Test Iterations.
'FastRestart'
— Run iterations using fast restartfalse
(default) | true
Indicate if the test iterations run using fast restart mode, specified as
true
or false
.
'SaveBaselineRunInTestResult'
— Save baseline in test resultfalse
(default) | true
Indicate if the test case saves the baseline used in the test result after test execution,
specified as true
or false
.
'SaveInputRunInTestResult'
— Save input in test resultfalse
(default) | true
Enable saving external input run used in test result, specified as true
or
false
.
'StopSimAtLastTimePoint'
— Stop simulation at last input timefalse
(default) | true
Enable stopping the simulation at the final time value of the input, specified as
true
or false
.
'LoadAppFrom'
— Application location1
(default) | 2
| 3
Location from which to load the application, specified as an integer. This property is available only in real-time test cases.
1
— Model
2
— Target application
3
— Target computer
For more information on real-time testing, see Test Models in Real Time.
'TargetComputer'
— Target computer nameName of the target computer, specified as a character vector. This property is available only in real-time test cases. For more information on real-time testing, see Test Models in Real Time.
'TargetApplication'
— Target application name and pathName and path of the target application, specified as a character vector. This property is available only in real-time test cases. For more information on real-time testing, see Test Models in Real Time.
% Create the test file, test suite, and test case structure tf = sltest.testmanager.TestFile('API Test File'); ts = createTestSuite(tf,'API Test Suite'); tc = createTestCase(ts,'baseline','Baseline API Test Case'); % Remove the default test suite tsDel = getTestSuiteByName(tf,'New Test Suite 1'); remove(tsDel); % Assign the system under test to the test case setProperty(tc,'Model','sldemo_absbrake');