Main Content

getInputRuns

Class: sltest.testmanager.TestCaseResult, sltest.testmanager.TestIterationResult
Namespace: sltest.testmanager

Get inputs from simulations captured with the test result

Syntax

runArray = getInputRuns(result)

Description

runArray = getInputRuns(result) gets the simulation inputs from the test result.

Input Arguments

expand all

Test results to get simulation input results from, specified as a sltest.testmanager.TestCaseResult or sltest.testmanager.TestIterationResult object.

Output Arguments

expand all

Simulation run input results, returned as a Simulink.sdi.Run object array.

Examples

expand all

Load the Example Model and Create a New Test File

open_system('slexAutotransRootInportsExample');
tf = sltest.testmanager.TestFile('Input Run Test File');

Get the Test Suite and Test Case Objects

ts = getTestSuites(tf);
tc = getTestCases(ts);

Add the Model as the System Under Test and Save the Input Run

setProperty(tc,'Model','slexAutotransRootInportsExample','SaveInputRunInTestResult',true);

Add Excel® Data to Inputs Section and Specify Sheets to Add

excelfile = 'sltestExampleInputs.xlsx';
input = addInput(tc,excelfile,'Sheets',["Acceleration","Braking"]);

Map the Input Signal for the Sheets by Block Name

map(input(1),0);
map(input(2),0);

Capture the baseline criteria

baseline = captureBaselineCriteria(tc,'baseline_API.mat',true);

Run the Test Case and Get the Test Case and Iteration Results

resultsObj = run(tc);
tcr = getTestCaseResults(resultsObj);
tir = tcr.getIterationResults;

Get the Inputs From the Simulation Run

inrun = tir(1).getInputRuns;

Version History

Introduced in R2017a