Documentation

sltest.testmanager.CustomCriteria class

Package: sltest.testmanager
Superclasses:

Add or modify custom criteria

Description

An instance of sltest.testmanager.CustomCriteria is a test case custom criteria that evaluates the simulation output, returning a pass or fail result.

Construction

obj = getCustomCriteria(tc) creates an sltest.testmanager.CustomCriteria object for a test case object tc.

output_args = function(input_args,Name,Value).

Properties

expand all

Property that enables or disables the custom criteria for evaluation, specified as a logical.

Example: true

Property that defines the custom criteria script, specified as a character array.

Example: test.verifyEqual(lastPhi,0,['Final: ',num2str(lastPhi),'.']);

Examples

expand all

Create a test case object from the test suite ts.

tc = ts.getTestCaseByName('Requirement 1.3 Test');

Get the custom criteria from the test case tc.

tcCriteria = getCustomCriteria(tc);

Set the custom criteria script.

tcCriteria.Callback = 'test.verifyEqual(lastPhi,0);'

Enable the custom criteria.

tcCriteria.Enabled = true;

Introduced in R2016b

Was this topic helpful?