sltest.testmanager.TestIterationResult class

Package: sltest.testmanager
Superclasses:

Access test iteration result data

Description

Instances of sltest.testmanager.TestIterationResult enable you to access the results from test execution performed by the Test Manager at a test-iteration level. The hierarchy of test results is Result Set > Test File Result > Test Suite Result > Test Case Result > Test Iteration Result.

Construction

The function sltest.testmanager.run creates a sltest.testmanager.ResultSet object, which contains the test case result object.

Properties

expand all

The outcome of an individual test iteration result. The integer 0 means the test iteration was disabled, 1 means the test iteration execution was incomplete, 2 means the test iteration passed, and 3 means the test iteration failed.

This property is read-only.

Length of time the test iteration ran, in seconds, returned as a duration.

This property is read-only.

Time the test iteration began to run, returned as a datetime.

This property is read-only.

Time the test completed, returned as a datetime.

The path of the test file used to create the test iteration result.

The hierarchy path in the parent result set.

The type of test case from the three available test cases in the Test Manager: simulation, baseline, and equivalence.

Indicates if the simulation ran on the target or not, returned as an array of Booleans.

Parent of the result. The parent of a test iteration result is a test case result object.

Error messages produced by the iteration, returned as a array of strings.

Log messages produced by the iteration, returned as a array of strings.

Methods

getBaselineRunGet test iteration baseline dataset
getComparisonResult Get test data comparison result
getComparisonRunGet test iteration signal comparison results
getCoverageResultsGet coverage results
getCustomCriteriaPlotsGet plots from custom criteria
getCustomCriteriaResultGet custom criteria results from test iteration
getInputRunsGet inputs from simulations captured with the test result
getOutputRunsGet test iteration simulation output results
getSimulationPlotsGet plots from callbacks
getTestIteration Get test iteration that produced result
getVerifyRunsGet test iteration verify statement

Examples

collapse all

% Create the test file, suite, and case
tf = sltest.testmanager.TestFile...
   ('Get Test Iteration Results File');
ts = createTestSuite(tf,'Test Suite');
tc = createTestCase(ts,'baseline','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');

% Specify iterations
vars = 32 : 0.5 : 34;

for k = 1 : length(vars)

    % Create test iteration object
    testItr = sltest.testmanager.TestIteration;

    % Set the parameter value for this iteration
    setVariable(testItr,'Name','g','Source',...
       'base workspace','Value',vars(k));

    str = sprintf('Iteration %d',k);

    % Add the iteration object to the test case
    addIteration(tc,testItr,str);
end

% Run the test and capture results
resultset = run(tf);
tfr = getTestFileResults(resultset);
tsr = getTestSuiteResults(tfr);
tcr = getTestCaseResults(tsr);
tir = getIterationResults(tcr);

% Get the test case type from first iteration
testType = tir(1).TestCaseType;
Introduced in R2016a