Package: matlab.unittest.selectors
Selector for TestSuite
elements determined
by procedure name
The HasProcedureName
selector filters TestSuite
array
elements determined by the procedure name. The name of the test procedure does not
include any class or package name or information about parameterization. In a
class-based test, the procedure name is the name of the test method. In a function-based
test, it is the name of the local function that contains the test. In a script-based
test, it is a name generated from the test section title.
matlab.unittest.selectors.HasProcedureName(
constructs
a selector for n
)TestSuite
elements determined by the
procedure name, n
.
For a test element to be included in the suite, the procedure name of the test element must match the specified name or satisfy the specified constraint.
Value. To learn how value classes affect copy operations, see Copying Objects.
Use the HasProcedureName
selector for maximum flexibility to create test
suites from procedure names. Alternatively, at the time of test suite construction, you
can filter the test suite using the 'ProcedureName'
name-value pair.
For example, the following lines of code are functionally equivalent.
s = TestSuite.fromClass(?ExampleTest,'ProcedureName','Test1'); s = testsuite('ExampleTest.m','ProcedureName','Test1');
fromClass
| fromFile
| fromFolder
| fromMethod
| fromPackage
| matlab.unittest.selectors
| selectIf