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.

saveToFile

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

Save test file

Syntax

saveToFile(tf)
saveToFile(tf,filePath)

Description

saveToFile(tf) saves the changes to the test file.

saveToFile(tf,filePath) saves the test file to the specified file path.

Input Arguments

expand all

Test file, specified as a sltest.testmanager.TestFile object.

The file path and name to save the test file at, specified as a character vector.

Example: 'C:\MATLAB\New Test File.mldatx'

Examples

expand all

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('C:\MATLAB\My Test File.mldatx');
ts = createTestSuite(tf,'My Test Suite');
tc = createTestCase(ts,'simulation','Simulation Test Case');

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

% Assign the system under test to the test case
setProperty(tc,'Model','sldemo_autotrans');

% Save the test file
saveToFile(tf);

% Save test file object as another test file
saveToFile(tf,'C:\MATLAB\New Test File.mldatx');

Introduced in R2015b