Create or modify test file
sltest.testmanager.TestFile are files that can contain test
suites and test cases.
For MATLAB®-based Simulink® tests, test files correspond to the file name. See Test Models Using MATLAB-Based Simulink Tests for more information.
obj = sltest.testmanager.TestFile(
sltest.testmanager.TestFile object with a default test
suite and test case as children of the test file. The default test case type is a
baseline test case. If the test file exists on the path, a new test file is not
filePath— File name and path
The file name and path of the test file, specified as a character vector. The file can be a
test file (
.mldatx), or a MATLAB script test file
.m), if that script file is a derived class from
sltest.TestCase. The specified file name determines
the name of the test file as seen in the Test Manager.
mode— Override existing test files
Indicate if you want to override a test file with the same file name and path, specified as
Description— Test file description
Test file description text, specified as a character vector.
Dirty— Unsaved changes indicator
Indicates if the test file has unsaved changes,
no unsaved changes, and
1 if there are
Enabled— Test file execution indicator
Indicates if test cases that are children of the test file will
execute, specified as a logical value
FilePath— File path and name
File path and name of the test file, returned as a character vector.
Name— Test file name
Name of the test file without the file path and file extension, returned as a character vector.
Releases— Releases available for testing
This property is read-only.
Releases available for testing, returned as a string array. Add releases using
ReasonForDisabling— Disabled description
Description text for why the test file was disabled, specified
as a character vector. This property is visible only when the
is set to
Requirements— Test file requirements
The requirements that are attached at the test-file level, returned as a structure.
Tags— Tags to categorize by
Tags to use for categorizing, specified as a character vector or string array.
|close||Close test file in Test Manager|
|convertTestType||Convert test from one type to another|
|createTestForSubsystem||(To be removed) Create test harness and test case for subsystem in test file|
|createTestSuite||Create new test suite|
|getCoverageSettings||Get coverage settings|
|getOptions||Get and set test file options|
|getProperty||Get test file property|
|getTestCaseByName||Get test case object by name|
|getTestCases||Get test cases in a test file|
|getTestSuiteByName||Get test suite object by name|
|getTestSuites||Get test suites at first level of test file|
|run||Run test cases in test file|
|saveToFile||Save test file|
|setProperty||Set test file property|
Create a new test file and return the test file object.
testfile = sltest.testmanager.TestFile('C:\MATLAB\test_file.mldatx')
testfile = TestFile with properties: Name: 'test_file' FilePath: 'C:\MATLAB\test_file.mldatx' Dirty: 1 Requirements: [0x1 struct] Description: '' Enabled: 1