setProperty

Class: sltest.testmanager.TestCase
Package: sltest.testmanager

Set test case property

Syntax

setProperty(tc,Name,Value)

Description

setProperty(tc,Name,Value) sets a test case property.

Input Arguments

expand all

Test case to set property, specified as an sltest.testmanager.TestCase object.

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 quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'StopTime',100

The model name in the System Under Test section, specified as a character vector.

Example: 'sldemo_absbrake'

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'

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.

Indicate if the test case overrides the model start time, specified as true or false.

Model start time, specified as a scalar value.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Indicate if the test case overrides the model stop time, specified as true or false.

Model stop time, specified as a scalar value.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Indicate if the test case overrides the model initial state, specified as true or false.

Model initial state from a workspace variable, specified as a character vector.

Name of a test harness to use in the System Under Test section, specified as a character vector.

Name of the test harness owner, specified as a character vector.

Indicate if the test case overrides the model and uses a different Signal Builder group in the Inputs section, specified as true or false.

Signal Builder group name, specified as a character vector. To return to the default model settings, specify an empty character vector, ''.

Indicate if the test case overrides the model settings under the Outputs section, specified as true or false.

Indicate if the test case overrides saving model output, specified as true or false.

Indicate if the test case is set to save output state values, specified as true or false.

Indicate if the test case is set to log signals marked for logging in the model, specified as true or false.

Indicate if the test case is set to log Data Store variables, specified as true or false.

Indicate if the test case is set to store final state values, specified as true or false.

Simulation number that the property applies to, specified as an integer, 1 or 2. This setting applies to the simulation test case.

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

Name of the configuration setting in a model, specified as a character vector.

Variable name in a configuration set file, specified as a character vector.

File name and path of the configuration set, specified as a character vector.

Pre-load callback script, specified as a character vector.

Post-load callback script, specified as a character vector.

Test-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'

Character 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.

Iteration script evaluated to create test case iterations, specified as a character vector. For more information about test iteration scripts, see Test Iterations.

Indicate if the test iterations run using fast restart mode, specified as true or false.

Indicate if the test case saves the baseline used in the test result after test execution, specified as true or false.

Enable saving external input run used in test result, specified as true or false.

Enable stopping the simulation at the final time value of the input, specified as true or false.

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.

Name 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.

Name 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.

Examples

expand all

% 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');
Introduced in R2015b