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.


Class: sltest.testmanager.TestCase
Package: sltest.testmanager

Capture baseline criteria and add to test case


baseline = captureBaselineCriteria(tc,file,append)
baseline = captureBaselineCriteria(tc,file,append,Name,Value)


baseline = captureBaselineCriteria(tc,file,append) runs the system under test and captures a baseline criteria set as a MAT-file or Microsoft® Excel® file. The function returns a baseline criteria object, sltest.testmanager.BaselineCriteria. Use this function only if the test type is a baseline test case.

baseline = captureBaselineCriteria(tc,file,append,Name,Value) uses additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

Test case to capture baseline criteria in, specified as an sltest.testmanager.TestCase object.

Name and file path to save the baseline criteria file to, specified as a character vector.

Append baseline criteria if criteria already exists, specified as a Boolean. The Boolean true appends to existing criteria, and false replaces existing criteria.

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: 'Sheet','mysheet','Range','C1:F10'

Pairs for MAT-Files andMicrosoft Excel Files

expand all

Simulink release to capture the baseline data in, specified as a character vector or string array. Use a release specified in your preferences. For more information, see sltest.testmanager.getpref and sltest.testmanager.setpref.

Example: 'Release','R2017a'

Pairs Only for Microsoft Excel Files

expand all

Name to sheet to capture baseline criteria to, specified as a character vector or string array.

Example: 'Sheet','testinputs'

Ranges of cells to capture baseline criteria to, specified as a character vector or string array. You can specify 'Range' only if you also specify 'Sheet'.

Example: 'Range','B2:C30'

Output Arguments

expand all

Baseline criteria added to the test case, returned as an sltest.testmanager.BaselineCriteria object.


expand all

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'baseline','Baseline API Test Case');

% Remove the default test suite
tsDel = getTestSuiteByName(tf,'New Test Suite 1');

% Assign the system under test to the test case

% Capture the baseline criteria
baseline = captureBaselineCriteria(tc,'baseline_API.mat',true);

Introduced in R2015b