Documentation

sltest.testmanager.TestFile class

Package: sltest.testmanager
Superclasses:

Create or modify test file

Description

Instances of sltest.testmanager.TestFile are files that can contain test suites and test cases.

Construction

obj = sltest.testmanager.TestFile(filePath,mode) creates a 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 in the Test Manager, then a new test file is not created.

Input Arguments

expand all

The file name and path of the test file, specified as a character vector. The specified file name determines the name of the test file as seen in the Test Manager.

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

Indicate if you want to override a test file with the same file name and path, specified as either 'true' or 'false'.

Properties

expand all

Test file description text, specified as a character vector.

Indicates if the test file has unsaved changes, 0 if there are no unsaved changes, and 1 if there are unsaved changes.

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

File path and name of the test file, returned as a character vector.

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

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

This property is read-only.

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

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.

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

Methods

closeClose test file in Test Manager
convertTestTypeConvert test from one type to another
createTestForSubsystemCreate test case for subsystem
createTestSuiteCreate new test suite
getCoverageSettingsGet coverage settings
getOptionsGet and set test file options
getPropertyGet test file property
getTestSuiteByNameGet test suite object by name
getTestSuitesGet test suites at first level of test file
runRun test cases in test file
saveToFileSave test file
setPropertySet test file property

Examples

expand all

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

Introduced in R2015b

Was this topic helpful?