Main Content

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 Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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');

Version History

Introduced in R2015b