Create TestRunner object for command window output
runner = matlab.unittest.TestRunner.withTextOutput
runner = matlab.unittest.TestRunner.withTextOutput creates a TestRunner object that is configured for running tests from the MATLAB® Command Window and returns it in runner. The output produced includes test progress as well as diagnostics in the event of test failures.
To learn about attributes of methods, see Method Attributes in the MATLAB Object-Oriented Programming documentation.
Add matlab.unittest classes to the current import list.
import matlab.unittest.TestRunner; import matlab.unittest.TestSuite;
Create a TestSuite array.
suite = TestSuite.fromClass(?mypackage.MyTestClass);
Create a TestRunner object that produced output to the Command Window.
runner = TestRunner.withTextOutput; % Run the suite result = run(runner,suite)