Main Content

getVerifyRuns

Class: sltest.testmanager.TestCaseResult
Package: 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.

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.

rollModel = 'TransmissionDownshiftTestSeqVerify';
testHarness = 'TransmissionDownshiftTestSeqVerify_Harness1';
testFile = 'TransmissionDownshiftTestSeqVerify.mldatx';

open_system(rollModel);
testFile =  sltest.testmanager.load(testFile);
sltest.harness.open([rollModel,'/shift_controller'],testHarness);

open_system([testHarness,'/Test Sequence'])
open_system([testHarness,'/Test Assessment Block'])

ro = run(testFile);
tfr = getTestFileResults(ro);
tsr = getTestSuiteResults(tfr);
tcr = getTestCaseResults(tsr);

verifyOut = getVerifyRuns(tcr);
signals = getAllSignals(verifyOut);

assessmentSignals = signals...
    ({signals.Domain} == "Assessments");
dataset = export(assessmentSignals);
results = arrayfun(@(idx) dataset{idx}.Result,...
    1:numElements(dataset))
results = 
  1x3 slTestResult enumeration array

    Pass    Pass    Pass

close_system('TransmissionDownshiftTestSeqVerify_Harness1')
close_system('TransmissionDownshiftTestSeqVerify')
sltest.testmanager.clear
sltest.testmanager.clearResults
sltest.testmanager.close

Version History

Introduced in R2016a