getComparisonRun

Class: sltest.testmanager.TestCaseResult
Package: sltest.testmanager

Get test case signal comparison results

Syntax

run = getComparisonRun(result)

Description

run = getComparisonRun(result) gets the test case comparison results that belong to the test case results object. The results are output to a Simulink.sdi.Run object, which contains signal data for each comparison, tolerance, and difference result.

Input Arguments

expand all

Test case results to get comparison results from, specified as a sltest.testmanager.TestCaseResult object.

Output Arguments

expand all

Test case comparison signal results, returned as a Simulink.sdi.Run object.

Examples

expand all

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'baseline','Baseline API Test Case');

% Remove the default test suite
tsDel = getTestSuiteByName(tf,'New Test Suite 1');
remove(tsDel);

% Assign the system under test to the test case
setProperty(tc,'Model','sldemo_absbrake');

% Capture the baseline criteria and record baseline
baseline = captureBaselineCriteria(tc,'baseline_API.mat',true);

% Test a new model parameter by overriding it in the test case
% parameter set
ps = addParameterSet(tc,'Name','API Parameter Set');
po = addParameterOverride(ps,'m',55);

% Set the baseline criteria tolerance for one signal
sc = getSignalCriteria(baseline);
sc(1).AbsTol = 9;

% Run the test case and return an object with results data
resultsObj = run(tc);

% Get test case result
tcr = getTestCaseResults(resultsObj);

% Get the baseline run dataset
compOut = getComparisonRun(tcr);

Introduced in R2015a