Main Content

sltest.testmanager.TestSuite class

Package: sltest.testmanager

Create or modify test suite


Instances of sltest.testmanager.TestSuite can contain other test suites and test cases. For MATLAB®-based Simulink® tests, test suites are implemented using class and method parameters. See Test Models Using MATLAB-Based Simulink Tests for more information.


obj = sltest.testmanager.TestSuite(parent,name) creates a sltest.testmanager.TestSuite object as a child of the specified parent. You can use test files or other test suites as the parent.

Input Arguments

expand all

Parent object for the test suite to reside in. The parent object can be a test file or a another test suite, specified as an sltest.testmanager.TestFile or sltest.testmanager.TestSuite object.

Name of the test suite, specified as a character vector. If this is empty, a unique name is created.

Example: 'Coverage Test Suite'


expand all

Test suite description text, specified as a character vector.

Indicates if test cases that are children of the test suite execute, specified as a logical value true or false.

Name of the test file without the file path and file extension, returned as a character vector.

Test file or test suite that is the parent of the specified test suite, returned as a sltest.testmanager.TestFile or sltest.testmanager.TestSuite object.

Description text for why the test suite was disabled, specified as a character vector. This property is visible only when the Enabled property is set to false.

This property is read-only.

Releases available for testing, returned as a string array. Add releases using sltest.testmanager.setpref.

The requirements that are attached at the test-suite level, returned as a structure.

Tags to use for categorizing, specified as a character vector or string array.

Test file that is the parent of the test suite, returned as a sltest.testmanager.TestFile object.

Test file and test suite hierarchy, returned as a character vector.


convertTestTypeConvert test from one type to another
createTestCaseCreate test case
createTestForSubsystem(To be removed) Create test harness and test case for subsystem in test suite
createTestSuiteCreate test suite
getCoverageSettingsGet coverage settings
getOptionsGet test file options
getPropertyGet test suite property
getTestCaseByNameGet test case object by name
getTestCasesGet test cases at first level of test suite
getTestSuiteByNameGet test suite object by name
getTestSuitesGet test suites at first level of test suite
removeRemove test suite
runRun test cases in test suite
setPropertySet test suite property


collapse all

% Create test file
testfile = sltest.testmanager.TestFile('C:\MATLAB\test_file.mldatx');

% Create test suite
testsuite = sltest.testmanager.TestSuite(testfile,'My Test Suite')
testsuite = 

  TestSuite with properties:

            Name: 'My Test Suite'
        TestFile: [1x1 sltest.testmanager.TestFile]
        TestPath: 'test_file > My Test Suite'
          Parent: [1x1 sltest.testmanager.TestFile]
    Requirements: [0x1 struct]
     Description: ''
         Enabled: 1
Introduced in R2015b