Main Content

sltest.testmanager.CustomCriteria class

Package: sltest.testmanager

Add or modify custom criteria


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


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

output_args = function(input_args,Name,Value).


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),'.']);


collapse 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