runInParallel
Class: matlab.unittest.TestRunner
Namespace: matlab.unittest
Run all tests in test suite in parallel
Description
results = runInParallel(
divides the specified test suite into groups and uses the specified test runner to
run each group on the parallel pool returned by the runner
,suite
)gcp
(Parallel Computing Toolbox) function. The method returns the
results as an array of TestResult
objects.
When tests run in parallel (requires Parallel Computing Toolbox™), 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 Test
elements to run the tests.
Each Test
element provides the worker with all the information
required to run a test.
Note
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