Create a package folder, +mytestpackage
, in your
current folder. This package contains two test classes.
In the +mytestpackage
folder, create a test class named
AExampleTest
. This class contains two tests that use
a suppressed warnings fixture.
In the +mytestpackage
folder, create a test class named
BExampleTest
. This class contains one test that uses
a shared path fixture and a suppressed warnings fixture.
At the command prompt, define the following fixtures.
Create a test suite from the package.
suite =
1×3 Test array with properties:
Name
ProcedureName
TestClass
BaseFolder
Parameterization
SharedTestFixtures
Tags
Tests Include:
0 Parameterizations, 2 Unique Shared Test Fixture Classes, 0 Tags.
The test suite has three test elements.
Create a filtered suite that only contains tests that
use the path fixture, pf
.
The resulting suite, s1
, contains the test element from
BExampleTest
, since the test in that class uses the
shared test fixture, pf
.
Alternatively, pass the selector to the TestSuite.fromPackage
method
instead of generating a full test suite, and then using the TestSuite.selectIf
method
to filter the suite.
Create a filtered test suite that contains tests that
use the suppressed warnings fixture, swf
, but not
the path fixture, pf
.
The test suite, s2
, only contains the two test elements from
AExampleTest
. Tests in
BExampleTest
are excluded because, in addition to the
suppressed warnings fixture, they use the path fixture.
Create a filtered suite that only contains tests that
use the path fixture to a different location.
s3 =
1×0 Test array with properties:
Name
ProcedureName
TestClass
BaseFolder
Parameterization
SharedTestFixtures
Tags
Tests Include:
0 Parameterizations, 0 Shared Test Fixture Classes, 0 Tags.
The test suite does not contain any test elements. The tests in
BExampleTest
use a shared path fixture, but the
selected path fixture, pf2
, adds a different folder to
the path so its tests are not included in the suite.