Create suite of tests
suite = testsuite
creates a suite of tests from your current folder, and returns the suite as a Test
array.
To run a test suite created with testsuite
, use the run
method of matlab.unittest.TestSuite
, matlab.unittest.TestRunner
, or matlab.perftest.TimeExperiment
.
suite = testsuite(
creates a suite from a set of specified tests.tests
)
suite = testsuite(
creates a suite of tests with additional options specified by one or more tests
,Name,Value
)Name,Value
pair arguments.
If you do not need to create a test suite explicitly, use runtests
or runperf
to create the suite implicitly before running the tests.
An alternative way to create an explicit test suite is to use the matlab.unittest.TestSuite
methods.
When you specify the input to the testsuite
function as a
string array or cell array of character vectors (for example, suite =
testsuite(["Test1","Test2"])
), the testing framework sorts the
array to reduce shared test fixture setup and teardown operations. As a result,
the tests might run in an order that is different from the order of elements in
the input array.
To enforce the order of the test run, create the suite by using several calls
to testsuite
. For example, to ensure that the tests specified
by Test1
run before the tests specified by
Test2
, use this syntax:
suite = [testsuite("Test1") testsuite("Test2")]
matlab.unittest.TestSuite
| run (TestRunner)
| run (TestSuite)
| run (TimeExperiment)
| runtests