testrunner
Syntax
Description
runner = testrunner
creates a default test runner, which is similar
to the runner that the testing framework configures by default when you call the runtests
function.
The testrunner
function returns a matlab.unittest.TestRunner
object. You can call the methods on the returned
object to run and operate on your test suite and to customize running tests. For example, to
run a suite of tests, use run(runner,suite)
.
runner = testrunner("minimal")
creates a minimal runner with no
plugins installed. The returned test runner is the simplest runner possible and produces no
text output. Use this syntax when you want to have complete control over which plugins to
add to the runner.
runner = testrunner("textoutput")
creates a runner that is
configured for text output. The output produced includes test progress as well as
diagnostics in the event of test failures.
This syntax creates runners that tend to run tests more quickly, because the testing framework does not record diagnostics on test results produced by a nondefault runner. For more information, see Programmatically Access Test Diagnostics.
runner = testrunner(___,
specifies options using one or more name-value arguments in addition to any of the input
argument combinations in previous syntaxes. For example, Name=Value
)runner =
testrunner("textoutput",OutputDetail="verbose")
creates a test runner that
displays test output detail at the maximum verbosity level. (since R2024b)
Examples
Input Arguments
Tips
The runner created with
testrunner("minimal")
is the same as the runner created using thematlab.unittest.TestRunner.withNoPlugins
method.The runner created with
testrunner("textoutput")
is the same as the runner created using thematlab.unittest.TestRunner.withTextOutput
method with no input arguments.