Allow "-j0" as an argument to regrtest, to automatically select an
appropriate number of parallel workers.
This commit is contained in:
parent
5066b03361
commit
6ab79d9d5b
|
@ -374,6 +374,13 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
|
|||
forever = True
|
||||
elif o in ('-j', '--multiprocess'):
|
||||
use_mp = int(a)
|
||||
if use_mp <= 0:
|
||||
try:
|
||||
import multiprocessing
|
||||
# Use all cores + extras for tests that like to sleep
|
||||
use_mp = 2 + multiprocessing.cpu_count()
|
||||
except (ImportError, NotImplementedError):
|
||||
use_mp = 3
|
||||
elif o == '--header':
|
||||
header = True
|
||||
elif o == '--slaveargs':
|
||||
|
|
Loading…
Reference in New Issue