- Trait that causes that the tests of any suite it is mixed into to be run in parallel if
Distributor is passed to
ScalaTest's normal approach for running suites of tests in parallel is to run different suites in parallel,
but the tests of any one suite sequentially. This approach should provide sufficient distribution of the work load
in most cases, but some suites may encapsulate multiple long-running tests. Such suites may dominate the execution
time of the run. If so, mixing in this trait into just those suites will allow their long-running tests to run in parallel with each
other, thereby helping to reduce the total time required to run an entire run.
Because this trait extends
each test will be run its own instance of the suite's class. This trait overrides the
runTests method. If no
Distributor is passed to
this trait's implementation simply invokes its supertrait
runTests, which will run each test in its own instance sequentially. If a
is passed, however, this traits' implementation of
runTests will, for each test, wrap a new instance of the
suite in a special wrapper suite that will invoke just that one test, and passes the wrapper suites to the
The thread or entity that takes a wrapper suite from the
Distributor will invoke
on the wrapper suite, which will run just one test. In this way, different tests of a suite that mixes in
ParallelTestExecution will run in parallel.
- Bill Venners
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
runTests(testName : scala.Option[java.lang.String], reporter : Reporter, stopper : Stopper, filter : Filter, configMap : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor], tracker : Tracker) : Unit
- Run the tests of this suite in parallel.
testName - an optional name of one test to run. If
None, all relevant tests should be run. I.e.,
None acts like a wildcard that means run all relevant tests in this
reporter - the
Reporter to which results will be reported
stopper - the
Stopper that will be consulted to determine whether to stop execution early.
filter - a
Filter with which to filter tests based on their tags
configMap - a
Map of key-value pairs that can be used by the executing
Suite of tests.
distributor - an optional
Distributor, into which to put nested
Suites to be run by another entity, such as concurrently by a pool of threads. If
Suites will be run sequentially.
tracker - a
Ordinals being fired by the current thread.
NullPointerException - if any of the passed parameters is
IllegalArgumentException - if
testName is defined, but no test with the specified test name exists in this
Copyright (C) 2001-2009 Artima, Inc. All rights reserved.