sltest.testmanager.TestIterationResult Class
Namespace: sltest.testmanager
Access test iteration result data
Description
Instances of sltest.testmanager.TestIterationResult
enable you to
access the results from test execution performed by the Test Manager at a test-iteration
level. The hierarchy of test results is Result Set > Test File Result > Test Suite
Result > Test Case Result > Test Iteration Result.
The sltest.testmanager.TestIterationResult
class is a handle
class.
Creation
Description
The function sltest.testmanager.run
creates a
sltest.testmanager.ResultSet
object, which contains the test case
result object. For an example, see Get Test Iteration Results
Properties
Outcome
— Outcome of test iteration result
0 | 1 | 2 | 3
The outcome of an individual test iteration result. The integer 0
means the test iteration was disabled, 1
means the test iteration
execution was incomplete, 2
means the test iteration passed, and
3
means the test iteration failed.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: integer
Name
— Test iteration name
string
Test iteration name, returned as a string.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
TestDataPath
— Input data file path
string
Path of the input data file, returned as a string.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
TestFilePath
— Test file path
character vector
The path of the test file used to create the test iteration result, returned as a character vector.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: char
TestCasePath
— Result hierarchy path
character vector
The hierarchy path in the parent result set.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: char
TestCaseType
— Type of test case
'Simulation'
| 'Baseline'
| 'Equivalence'
The type of test case from the three available test cases in the Test Manager: simulation, baseline, and equivalence.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: char
RunOnTarget
— Target indicator
cell array
Indicates if the simulation ran on the target or not, returned as an array of Booleans.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: logical
StartTime
— Time the test iteration began to run
datetime
Time the test iteration began to run, returned as a datetime.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: datetime
StopTime
— Time the test iteration completed
datetime
Time the test completed, returned as a datetime.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: datetime
Duration
— Length of time the test iteration ran, in seconds
duration
Length of time the test iteration ran, in seconds, returned as a duration.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: duration
Requirements
— Test iteration requirements
array of strings
Requirements associated with the test iteration, returned as an array of strings.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
ErrorMessages
— Error messages
array of strings
Error messages produced by the iteration, returned as a array of strings.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: string
LogMessages
— Log messages
array of strings
Log messages produced by the iteration, returned as a array of strings.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: string
CauseOfFailure
— Cause of test iteration failure
array of strings
Cause of the test iteration failure, returned as an array of strings.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
DisablingReason
— Disabled description
string
Description text for why the test iteration was disabled, returned as a string.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Baseline
— Name of baseline file
string
Name of the baseline file used in the test iteration, returned as a string.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
ExternalInput
— Name of external input file
string
Name of external input file, returned as a string.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
ParameterSet
— Test iteration parameters
ParameterSet
object
Test iteration parameters that can override model parameters, returned as a struct
containing the name of the sltest.testmanager.ParameterSet
object, path
to the object, and a structure that lists the parameter overrides.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
FaultSet
— Fault set information
structure
Fault set information, returned as a structure. The structure has two fields:
FaultSetNames
— The names of the fault set, returned as a character vector.SpecifiedFaults
— The enabled faults in the fault set, returned as a structure. Each field is a structure that contains three fields:ModelElement
— The model element path of the fault, returned as a character vector.FaultName
— The fault name, returned as a character vector.Trigger
— The fault trigger type, returned as a character vector.
For more information on these fault properties, see Specify Fault Properties (Simulink Fault Analyzer).
If you do not have Simulink® Fault Analyzer™, this property is empty.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
SignalEditorScenario
— Name of Signal Editor scenario
string
Name of Signal Editor scenario used in the test iteration, returned as a string.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
TestSequenceScenario
— Test sequence scenario
struct
Test sequence scenario used in the test iteration, returned as a struct. The struct
contains two fields, TestSequenceBlock
and
TestSequenceScenario
. The TestSequenceBlock
field is the path of the Test Sequence block containing the scenario that ran for this
iteration. The TestSequenceScenario
is the name of that scenario. The
test sequence information is returned in a TestIterationResult
object
only if the test case included iterations. If iterations were not included, the
TestSequenceScenario
is returned in a
TestCaseResults
object.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: struct
VariantConfiguration
— Variant configuration used in test iteration
string | character vector
Since R2024a
Variant configuration applied to the model before running the test iteration, specified as a string or character vector.
This property applies to models that have variant configurations created using
Variant Manager for Simulink, and the VariantConfiguration
test parameter was
specified on the test iteration object using the setTestParam
method.
For an example, see Run Executable for Different Variant Parameter Values Without Recompiling Code.
Example: "LinInterExpNoNoise"
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: char
| string
SimulationMetaData
— Metadata of the simulation
SimulationMetadata
object
Metadata of the simulation, returned as a Simulink.SimulationMetadata
object.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Release
— Release in which the test was run
character vector
Release in which the test was run, returned as a character vector.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Description
— Description of the test iteration
character vector
Description of the test iteration, returned as a character vector.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
CoverageResults
— Test coverage results
character array
Test coverage results, returned as a character array.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Tags
— Tags to filter test file results
string array
Tags to filter the test file results. Use tags to view a subset of the test results. See Tags for more information.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Parent
— Parent of the result object
sltest.testmanager.TestCaseResult
object
Parent of the test iteration result, returned as a TestCaseResult
object.
Attributes:
GetAccess | public |
SetAccess | private |
Dependent | true |
NonCopyable | true |
Data Types: sltest.testmanager.TestCaseResult
UserData
— Custom data stored with test iteration results
any data type
Custom data stored with the test iteration results, specified as any type of data. Use this field to add custom information, such as the settings used to obtain the results.
Attributes:
GetAccess | public |
SetAccess | public |
Dependent | true |
NonCopyable | true |
Methods
Public Methods
For getInputRuns
, see the
sltest.testmanager.testcaseresult
getInputRuns
method.
getAssessmentResults | Get logical and temporal assessment results for test iteration result |
getBaselineRun | Get test iteration baseline dataset |
getComparisonResult | Get test data comparison result |
getComparisonRun | Get test iteration signal comparison results |
getCoverageResults | Get coverage results |
getCustomCriteriaPlots | Get plots from custom criteria |
getCustomCriteriaResult | Get custom criteria results from test iteration |
getOutputRuns | Get test iteration simulation output results |
getOutputTriggerResults | Create output trigger results object for test iteration |
getSimulationPlots | Get plots from callbacks |
getTestIteration | Get test iteration that produced result |
getVerifyRuns | Get test iteration verify statement |
getTimingInfo | Timing execution information for test iteration results |
Examples
Get Test Iteration Results
Open the model for this example.
sldemo_absbrake
Create the test file, remove the default test suite, and add a new test suite and test case.
tf = sltest.testmanager.TestFile('Get Test Iteration Results File'); tsDel = tf.getTestSuites; remove(tsDel); ts = createTestSuite(tf,'Test Suite'); tc = createTestCase(ts,'baseline','Test Case');
Assign the system under test to the test case.
setProperty(tc,'Model','sldemo_absbrake');
Specify the parameter values for each iteration. Then run a for loop that creates a test iteration object for each iteration, sets the parameter value, and adds the iteration object to the test case structure.
vars = 32:0.5:34; for k = 1:length(vars) % Create test iteration object testItr = sltest.testmanager.TestIteration; % Set the parameter value for this iteration setVariable(testItr,'Name','g','Source',... 'base workspace','Value',vars(k)); str = sprintf('Iteration %d',k); % Add the iteration object to the test case addIteration(tc,testItr,str); end
Run the test and capture the results.
resultset = run(tf); tfr = getTestFileResults(resultset); tsr = getTestSuiteResults(tfr); tcr = getTestCaseResults(tsr); tir = getIterationResults(tcr);
Get the test case type from first iteration.
testType = tir(1).TestCaseType;
Clean up Test Manager.
sltest.testmanager.clear sltest.testmanager.clearResults sltest.testmanager.close
Version History
Introduced in R2016aR2024a: New property to obtain fault set results
Access the FaultSet
property to obtain the properties of the
activated fault set of a test. If you do not have Simulink
Fault Analyzer, this property is empty.
R2024a: New property for variant configuration
For variant models, the VariantConfiguration
property contains the
name of the variant configuration used in the test iteration object.
R2023a: New method to obtain triggered results
Use the new getOutputTriggerResults
method to obtain the results of a test that uses
triggers to control when signals are logged.
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)