setProperty

Class: sltest.testmanager.TestSuite
Package: sltest.testmanager

Set test suite property

Syntax

setProperty(ts,Name,Value)

Description

setProperty(ts,Name,Value) sets a test suite property.

Input Arguments

expand all

Test suite object to set the property, specified as an sltest.testmanager.TestSuite object.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'SetupCallback','a = 300; % set nominal value'

Test-suite level setup callback script, specified as a character vector. The function deletes any existing callback script and replaces it with the specified character vector.

Example: 'a = 300; % set nominal value'

Test-suite level cleanup callback script, specified as a character vector. The function deletes any existing callback script and replaces it with the specified character vector.

Example: 'clear a % clear value from workspace'

Examples

expand all

% Create a test file and new test suite
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');

% Set the setup callback property
setProperty(ts,'CleanupCallback','clearvars % Clear variables');

Introduced in R2015b