getProperty
Class: sltest.testmanager.TestCase
Namespace: sltest.testmanager
Get test case property
Syntax
val = getProperty(tc,propertyName)
val = getProperty(___,simulationIndex)
Description
gets
a test case property.val
= getProperty(tc
,propertyName
)
gets
a test case property. If the test case is an equivalence test case,
then specify the simulation index.val
= getProperty(___,simulationIndex
)
Input Arguments
tc
— Test case
sltest.testmanager.TestCase
object
Test case to get test setting property from, specified as an sltest.testmanager.TestCase
object.
propertyName
— Test case property
"Model"
| "SimulationMode"
| ...
Test case property names, specified as one of these options, as a string or character vector.
Set these properties by using the setProperty
method. The
available properties are:
"Model"
— Name of the model to be tested"SimulationMode"
— Simulation mode of the model during the test"OverrideSILPILMode"
— Override SIL or PIL simulation mode of block to Normal mode"HarnessName"
— Harness name used for the test"HarnessOwner"
— Harness owner name"ComponentUnderTestName"
— Name of Model block to test"OverrideStartTime"
— Override start time"StartTime"
— Start time override value of simulation"OverrideStopTime"
— Override stop time"StopTime"
— Stop time override value of simulation"StopSimAtLastTimePoint"
— Stop the simulation at end of input data instead of model Stop Time"OverrideInitialState"
— Override initial state"InitialState"
— String or character vector evaluated to specify the initial state of the system under test"PreloadCallback"
— String or character vector evaluated before the model loads and before model callbacks"PostloadCallback"
— String or character vector evaluated after the system under test loads andPostLoadFcn
callback completes"PreStartRealTimeApplicationCallback"
— String or character vector evaluated before the real-time application is started on target computer"CleanupCallback"
— String or character vector evaluated after simulation completes and model callbacks execute"UseSignalEditorScenarios"
— Use signal editor scenarios for test input"SignalEditorScenario"
— Signal editor scenario name to use"IsTestDataReferenced"
— Create test case using test data from an external file, such as an Excel® or MAT file"TestDataPath"
— Character vector path to the external file being referenced for creating the test case"Adapter"
— Function handle of adapter function to convert test data"SDIViewFile"
— Path to a Simulation Data Inspector view file"OverrideModelOutputSettings"
— Override model output settings"SaveOutput"
— Save simulation output"SaveState"
— Save model states during simulation"SaveFinalState"
— Save final state of simulation"SignalLogging"
— Log signals"DSMLogging"
— Log data store"ConfigsetOverrideSetting"
— Value to determine override of configuration set"ConfigsetName"
— Configuration set override name"ConfigsetFileLocation"
— Path to a MAT-file that contains a configuration set object"ConfigsetVarName"
— Name of the variable inConfigsetFileLocation
that is a configuration set"IterationScript"
— Character vector evaluated for test case iteration script"SimulationIndex"
— Determines which simulation a property applies to, applicable to the equivalence test case type"FastRestart"
— Indicates if test iterations run using fast restart mode"SaveBaselineRunInTestResult"
— Enable saving the baseline run used in the test case, saved in the test result"LoadAppFrom"
— Location to load real-time application from"TargetComputer"
— Target computer name"TargetApplication"
— Target application name"VariantConfiguration"
— Name of the variant configuration applied to the model before simulation (since R2024a)"RoadRunnerInstallationFolder"
— Installation folder of the RoadRunner application"RoadRunnerProjectFolder"
— Project folder of the RoadRunner project"RoadRunnerScenarioPath"
— Path to RoadRunner scenario file"RoadRunnerRunInConsoleMode"
— Option to run RoadRunner in console mode or graphical mode"RoadRunnerTurnOffPacing"
— Option to run RoadRunner scenario with pacing on or off"StopOnFailure"
— Option to stop the execution of the RoadRunner test case when a test iteration fails"OverrideRoadRunnerDefaultSettings"
— Override the RoadRunner default file and path settings in the Test Manager
simulationIndex
— Test case simulation number
1 | 2
Simulation number that the property applies to, specified as
an integer, 1
or 2
. This setting
applies to the simulation test case where there are two simulations.
For baseline and simulation test cases, the simulation index is 1
.
Output Arguments
val
— Property content
character vector | logical | scalar
The content of the test case property, returned as a character vector, logical, or scalar value.
Examples
Get Test Case Property
% Open the model for this example openExample('sldemo_absbrake'); % 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'); % Assign the system under test to the test case setProperty(tc,"Model",'sldemo_absbrake'); % Get and check the system under test model getProperty(tc,"Model");
Version History
Introduced in R2015bR2024a: Control execution of RoadRunner test cases
Use the StopOnFailure
property to specify whether to stop the
execution of a RoadRunner test case when an iteration fails. See the StopOnFailure property of setProperty
.
R2024a: Override RoadRunner default path settings
Use the OverrideRoadRunnerDefaultSettings
property to
override the default file and folder paths for RoadRunner tests.
R2024a: New property for variant configuration
For variant models, use the VariantConfiguration
property to
identify the variant configuration applied to the model before test execution. To
set the property, use the VariantConfiguration
argument in the setProperty
method.
R2023b: New RoadRunner test case properties
These properties have been added for the RoadRunner test case:
RoadRunnerInstallationFolder
RoadRunnerProjectFolder
RoadRunnerScenarioPath
RoadRunnerRunInConsoleMode
RoadRunnerTurnOffPacing
See setProperty
for information about
each property.
R2023a: New property for Model block name
Use the ComponentUnderTestName
property to specify the Model
block to test. The Model block can be at any level
of the model or test harness hierarchy.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)