Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

run

Class: matlab.unittest.TestSuite
Package: matlab.unittest

Run TestSuite array using TestRunner object configured for text output

Syntax

result = run(suite)

Description

result = run(suite) runs the TestSuite object defined by suite using a TestRunner object configured for text output.

Input Arguments

suite

Set of tests, specified as a matlab.unittest.TestSuite array.

Output Arguments

result

A matlab.unittest.TestResult object containing the result of the test run. result is the same size as suite and each element is the result of the corresponding element in suite.

Examples

expand all

Add matlab.unittest classes to the current import list.

import matlab.unittest.TestRunner;
import matlab.unittest.TestSuite;

Create a test suite and a test runner.

suite = TestSuite.fromClass(?mypackage.MyTestClass);
runner = TestRunner.withTextOutput;

The following test results are equivalent.

result = runner.run(suite)
result = run(suite)

Tips

  • This is a convenience method which is equivalent to using a TestRunner object created from the TestRunner.withTextOutput method to run suite.

Was this topic helpful?