Documentation Center

  • Trials
  • Product Updates

stSaveTestCases

Save systest.TestCase objects from SystemTest TEST-file

Syntax

testcases = stSaveTestCases(testFile, testCases)

Description

testcases = stSaveTestCases(testFile, testCases) saves testcases to testfile. testfile must be a SystemTest TEST-file (.test) available on the MATLAB® path or specified with a full path. testcases must be a 1xN systest.TestCase object.

If there is already a Test Case Data test vector present in testfile, the test vector will have its test cases overridden by testcases and testfile will be updated. If there is no Test Case Data test vector in testfile, then one with the name 'TestCases' will be created.

This will error if called when the testfile is open in the SystemTest™ desktop.

Examples

Name your test file and model; create a test to that name using that model; edit the test cases; save the test cases back to the test.

testFile = 'f14.test';
modelName = 'f14';

systest.createHarness(testFile, modelName);

testCases = systest.TestCase('My Test Case', 'u');
stSaveTestCases(testFile, testCases);
Was this topic helpful?