runInParallel
Class: matlab.unittest.TestRunner
Package: matlab.unittest
Run all tests in TestSuite
array in
parallel
Description
result = runInParallel(
divides the specified test suite into groups and uses the specified test runner to
run each group on the current parallel pool. The method then returns the results in
an array of runner
,suite
)TestResult
objects.
When tests run in parallel, test suite portions run independently on MATLAB® workers. For example, if your test class has a
TestClassSetup
method, the method runs locally on each
worker. Workers use the information in their corresponding
TestSuite
elements to run the tests. Each
TestSuite
element provides the worker with information on the
Test
method, test class, and shared test fixtures to run for
the suite element.
Note
The runInParallel
method requires Parallel Computing Toolbox™. The testing framework might vary the order and number of
groups or which tests it includes in each group.
Input Arguments
Examples
Tips
When you select a test suite to run in parallel, consider possible resource contention. For example, if your test fixtures access global resources, such as a database or a shared file on the same network, the parallel sessions could conflict with each other. In such cases, consider using a prebuilt shared test fixture.
When you run tests on a remote parallel pool (requires MATLAB Parallel Server™ and Parallel Computing Toolbox), MATLAB first copies the local folders containing your tests to the remote workers. To minimize the overhead associated with this step, make sure that these folders include only files that are relevant to your tests.
Version History
Introduced in R2015aSee Also
run (TestRunner)
| matlab.unittest.TestRunner
| matlab.unittest.TestSuite
| matlab.unittest.TestResult
| matlab.unittest.plugins.TestRunnerPlugin
| matlab.unittest.plugins.Parallelizable
| runtests
Topics
- Parallel Computing Fundamentals (Parallel Computing Toolbox)
- Run Tests in Parallel with Custom Plugin
- Compile MATLAB Unit Tests