Main Content

getVerifyRuns

Class: sltest.testmanager.TestCaseResult
Namespace: sltest.testmanager

Get test case verify statement

Syntax

dataset = getVerifyRuns(result)

Description

dataset = getVerifyRuns(result) 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.

Input Arguments

expand all

Test case results to get verify statement dataset from, specified as a sltest.testmanager.TestCaseResult object.

Output Arguments

expand all

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);
Use this code:
dataset = verifyOut.export;

Examples

expand all

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