This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

sltest.testmanager.TestCase class

Package: sltest.testmanager

Create or modify test case


Instances of sltest.testmanager.TestCase are test case objects.

If you want to modify the test case settings that define how the test case executes, use the methods sltest.testmanager.TestCase.setProperty and sltest.testmanager.TestCase.getProperty.


obj = sltest.testmanager.TestCase(parent,type,name) creates a sltest.testmanager.TestCase object as a child of the specified parent. You can specify the name of the test case and the test case type: baseline, equivalence, or simulation.

Input Arguments

expand all

Parent test suite for the test case to reside in, specified as an sltest.testmanager.TestSuite object.

Test case type, specified as 'baseline', 'equivalence', or 'simulation'. There are three test case types: baseline, equivalence, and simulation.

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

Example: 'Test Case 5'

Specify if you want to run the test case simulation on a target, specified as a cell array of Booleans. This is an optional argument. For more information on real-time testing, see Test Models in Real Time.


expand all

Test case description text, specified as a character vector.

Indicates if the test case will execute, specified as a logical value true or false.

Name of the test case, returned as a character vector.

Test suite that is the parent of the specified test case, returned as an sltest.testmanager.TestSuite object.

Description text for why the test file 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-file level, returned as a structure.

Indicates if the simulation runs on a target, returned as a cell array of Booleans.

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

The test case type, returned as a character vector. The test case type can be one of the three types: simulation, equivalence, or baseline.

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

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


addBaselineCriteriaAdd baseline criteria to test case
addInputAdd input file to test case
addIterationAdd test iteration to test case
addLoggedSignalSetAdd logged signal set to a test case
addParameterSetAdd parameter set
captureBaselineCriteriaCapture baseline criteria and add to test case
captureEquivalenceCriteriaCapture equivalence criteria and add to test case
convertTestTypeConvert test from one type to another
copySimulationSettingsCopy simulation setting in equivalence test case
createInputDataFileCreate file as basis for test case input signal data
deleteIterationsDelete test iterations that belong to test case
getBaselineCriteriaGet baseline criteria
getCoverageSettingsGet coverage settings
getCustomCriteriaGet custom criteria that belong to test case
getEquivalenceCriteriaGet equivalence criteria from test case
getInputsGet test case inputs
getIterationsGet test iterations that belong to test case
getLoggedSignalSetsGet logged signal set from a test case
getOptionsGet test file options
getParameterSetsGet test case parameter sets
getPropertyGet test case property
removeRemove test case
runRun test case
setPropertySet test case 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');

% Create test case
testcase = sltest.testmanager.TestCase(testsuite,'equivalence',...
				'Equivalence Test Case')
testcase = 

  TestCase with properties:

            Name: 'Equivalence Test Case'
        TestFile: [1x1 sltest.testmanager.TestFile]
        TestPath: 'test_file > My Test Suite > Equivalence Test Case'
        TestType: 'equivalence'
     RunOnTarget: {2x1 cell}
          Parent: [1x1 sltest.testmanager.TestSuite]
    Requirements: [0x1 struct]
     Description: ''
         Enabled: 1

Introduced in R2015b