主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

getComparisonRun

类: sltest.testmanager.TestCaseResult
命名空间: sltest.testmanager

获取测试用例信号比对结果

语法

run = getComparisonRun(result)

说明

run = getComparisonRun(result) 获取属于测试用例结果对象的测试用例比较结果。结果输出到 Simulink.sdi.Run 对象,其中包含每个比较、容差和差异结果的信号数据。

输入参数

全部展开

从测试用例结果中获取比较结果,指定为 sltest.testmanager.TestCaseResult 对象。

输出参量

全部展开

测试用例比较信号结果,以 Simulink.sdi.Run 对象形式返回。

示例

全部展开

% Open the model for this example
openExample('sldemo_absbrake');

% 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);

版本历史记录

在 R2015a 中推出