Commit 6ab79d9d authored by Antoine Pitrou's avatar Antoine Pitrou

Allow "-j0" as an argument to regrtest, to automatically select an

appropriate number of parallel workers.
parent 5066b033
......@@ -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':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment