Main Content

saveToFile

クラス: sltest.testmanager.TestFile
名前空間: sltest.testmanager

テスト ファイルを保存

構文

saveToFile(tf)
saveToFile(tf,filePath)

説明

saveToFile(tf) は、テスト ファイルに対する変更を保存します。

saveToFile(tf,filePath) は、指定されたファイル パスにテスト ファイルを保存します。

入力引数

すべて展開する

テスト ファイル。sltest.testmanager.TestFile オブジェクトとして指定します。

テスト ファイルを保存するファイルのパスと名前。文字ベクトルとして指定します。

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

すべて展開する

% Open the model for this example
openExample('sldemo_autotrans');

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

バージョン履歴

R2015b で導入