getVerifyRuns
Class: sltest.testmanager.TestCaseResult
Namespace: sltest.testmanager
Get test case verify statement
Syntax
dataset = getVerifyRuns(result)
Description
gets
the verify statement dataset from a test case result. Verify statements
are constructed in the Test Sequence or Test
Assessment blocks in the system under test.dataset
= getVerifyRuns(result
)
Input Arguments
result
— Test case result
sltest.testmanager.TestCaseResult
object
Test case results to get verify statement dataset from, specified
as a sltest.testmanager.TestCaseResult
object.
Output Arguments
dataset
— Verify statement dataset
Simulink.sdi.Run
object array
Test case verify statement dataset, returned as an array of Simulink.sdi.Run
objects.
Note
In releases before 2022b, the output is returned as a time series instead of a dataset. To view the verify results for the time series, instead of this code in the example:
dataset = export(assessmentSignals);
dataset = verifyOut.export;
Examples
Get Verify Output From Test Case
This example shows how to obtain the verify statement dataset from a test case result and view the assessment results. You use verify statements in the Test Sequence or Test Assessment blocks in the system under test. You can use the output, which is an array of objects, with Simulink.sdi.Run
.
model = "sf_car"; testHarness = "TestDownshiftPointsHarness"; testFile = 'TestDownshiftPoints.mldatx'; open_system(model); testFile = sltest.testmanager.load(testFile); sltest.harness.open("sf_car/shift_logic",testHarness); open_system("TestDownshiftPointsHarness/Test Sequence") open_system("TestDownshiftPointsHarness/Test Assessment") ro = run(testFile); tfr = getTestFileResults(ro); tsr = getTestSuiteResults(tfr); tcr = getTestCaseResults(tsr); verifyOut = getVerifyRuns(tcr); assessmentSignals = getAllSignals(verifyOut); dataset = export(assessmentSignals); results = arrayfun(@(idx) dataset{idx}.Result,... 1:numElements(dataset))
results = 1x3 slTestResult enumeration array Pass Pass Pass
close_system(testHarness) close_system(model) sltest.testmanager.clear sltest.testmanager.clearResults sltest.testmanager.close
Version History
Introduced in R2016a
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 (한국어)