This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

setProperty

Class: sltest.testmanager.TestFile
Package: sltest.testmanager

Set test file property

Syntax

setProperty(tf,Name,Value)

Description

setProperty(tf,Name,Value) sets a test file property.

Input Arguments

expand all

Test file object whose property to set, specified as an sltest.testmanager.TestFile 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-file level setup callback script, specified as a character vector. The function replaces any existing callback script with this value.

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

Test-file level cleanup callback script, specified as a character vector. The function replaces any existing callback script with this value.

Example: 'clear a % clear value from workspace'

Examples

expand all

% Create a test file
tf = sltest.testmanager.TestFile('API Test File');

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

Introduced in R2015b