4040import time
4141import threading
4242import utils
43+ import multiprocessing
4344
4445from os .path import join , dirname , abspath , basename , isdir , exists
4546from datetime import datetime
@@ -1237,6 +1238,8 @@ def BuildOptions():
12371238 default = False , action = "store_true" )
12381239 result .add_option ("-j" , help = "The number of parallel tasks to run" ,
12391240 default = 1 , type = "int" )
1241+ result .add_option ("-J" , help = "Run tasks in parallel on all cores" ,
1242+ default = False , action = "store_true" )
12401243 result .add_option ("--time" , help = "Print timing information after running" ,
12411244 default = False , action = "store_true" )
12421245 result .add_option ("--suppress-dialogs" , help = "Suppress Windows dialogs for crashing tests" ,
@@ -1258,6 +1261,8 @@ def ProcessOptions(options):
12581261 VERBOSE = options .verbose
12591262 options .arch = options .arch .split (',' )
12601263 options .mode = options .mode .split (',' )
1264+ if options .J :
1265+ options .j = multiprocessing .cpu_count ()
12611266 def CheckTestMode (name , option ):
12621267 if not option in ["run" , "skip" , "dontcare" ]:
12631268 print "Unknown %s mode %s" % (name , option )
0 commit comments