testrunner
R2026bCreate test runner
Syntax
Description
creates a default test
runner, which is equivalent to the runner that the testing framework configures by default
when you call the runner = testrunnerruntests function.
You can call the methods of runner 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).
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.runner = testrunner("textoutput")
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.
specifies options using one or more name-value arguments in addition to any of the input
argument combinations in previous syntaxes. For example, runner = testrunner(___,Name=Value)runner =
testrunner("textoutput",OutputDetail="Verbose") creates a test runner that
displays test output detail at the maximum verbosity level. (since R2024b)
Examples
Name-Value Arguments
Output Arguments
Tips
You can use the
testrunnerfunction instead of the static methods of thematlab.unittest.TestRunnerclass. This table shows thetestrunnerfunction call equivalent to each static method of thematlab.unittest.TestRunnerclass.testrunnerFunctionmatlab.unittest.TestRunnerClassr = testrunnerr = matlab.unittest.TestRunner.withDefaultPluginsr = testrunner("minimal")r = matlab.unittest.TestRunner.withNoPluginsr = testrunner("textoutput")r = matlab.unittest.TestRunner.withTextOutput