This example shows how to create a test file, test suite, and simulation test case programmatically. The test case runs on the sldemo_autotrans model and uses getTestCase to obtain the test case that produced the test results.
Clear existing test files from the Test Manager.
sltest.testmanager.clear;
Create test file, test suite, and test case.
tf = sltest.testmanager.TestFile('Test File 1');
ts = createTestSuite(tf,'Test Suite 1');
tc = createTestCase(ts,'simulation','Test Case 1');
Remove default test suite so that only the created test suite is used.
tsDel = tf.getTestSuites();
remove(tsDel(1));
Assign the system under test to the test case. Run the test.