sltest.testmanager.ComparisonSignalResult class

Package: sltest.testmanager

Access signal comparison results from a baseline or equivalence result

Description

You can access the results of a data comparison (such as a baseline or equivalence test) with instances of sltest.testmanager.ComparisonSignalResult.

Creation

getComparisonSignalResults(cr) creates instances of sltest.testmanager.ComparisonSignalResult, where cr is a sltest.testmanager.ComparisonRunResult object.

Properties

expand all

Pass or fail result of the run comparison, specified as a sltest.testmanager.ComparisonSignalOutcomes object.

Attributes:

SetAccess
private
GetAccess
public

Baseline signal, specified as a Simulink.sdi.Signal object.

Attributes:

SetAccess
private
GetAccess
public

Output signal, specified as a Simulink.sdi.Signal object.

Attributes:

SetAccess
private
GetAccess
public

Difference signal between baseline and output, specified as a Simulink.sdi.Signal object.

Attributes:

SetAccess
private
GetAccess
public

Methods

Examples

collapse all

This example shows how to programmatically get the comparison results of the second iteration of a baseline test case.

1. Get the path to the test file, then run the test file.

extf = fullfile(matlabroot,'examples','simulinktest',...
    'sltestTestCaseRealTimeReuseExample.mldatx');
tf = sltest.testmanager.TestFile(extf);
ro = run(tf);

2. Get the test iteration results.

tfr = getTestFileResults(ro);
tsr = getTestSuiteResults(tfr);
tcr = getTestCaseResults(tsr);
tir = getIterationResults(tcr);

3. Get the comparison run result of iteration 2.

cr2 = getComparisonResult(tir(2))

4. Get the comparison signal result of the run result.

cr2sig = getComparisonSignalResults(cr2)

5. Clear the results and the Test Manager.

sltest.testmanager.clearResults;
sltest.testmanager.clear;
sltest.testmanager.close;

Introduced in R2017b