Main Content

sltest.testmanager.createTestsFromModel

Generate test cases from a model

Description

testFile = sltest.testmanager.createTestsFromModel(filePath,modelName,testType) generates test cases based on the model structure. The function creates test cases from test harnesses and Signal Editor scenarios in the model and assigns them to a test file.

example

Examples

collapse all

Create a new test file with new test cases in the Test Manager. Each test case uses a Signal Editor scenario.

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

testFile = sltest.testmanager.createTestsFromModel...
('C:\MATLAB\TestFile.mldatx','sldemo_autotrans','baseline')
testFile = 

  TestFile with properties:

        Name: 'TestFile'
    FilePath: 'C:\MATLAB\TestFile.mldatx'
       Dirty: 0

Input Arguments

collapse all

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

Example: 'C:\MATLAB\TestFile.mldatx'

The name of the model to generate test cases from, specified as a character vector.

Example: 'mymodel'

The type of test cases to generate, specified as a character vector. The function creates test cases using this test case type.

Output Arguments

collapse all

Test file that contains the generated test cases, returned as an sltest.testmanager.TestFile object.

Version History

Introduced in R2015b