40
40
import time
41
41
import threading
42
42
import utils
43
+ import multiprocessing
43
44
44
45
from os .path import join , dirname , abspath , basename , isdir , exists
45
46
from datetime import datetime
@@ -1237,6 +1238,8 @@ def BuildOptions():
1237
1238
default = False , action = "store_true" )
1238
1239
result .add_option ("-j" , help = "The number of parallel tasks to run" ,
1239
1240
default = 1 , type = "int" )
1241
+ result .add_option ("-J" , help = "Run tasks in parallel on all cores" ,
1242
+ default = False , action = "store_true" )
1240
1243
result .add_option ("--time" , help = "Print timing information after running" ,
1241
1244
default = False , action = "store_true" )
1242
1245
result .add_option ("--suppress-dialogs" , help = "Suppress Windows dialogs for crashing tests" ,
@@ -1258,6 +1261,8 @@ def ProcessOptions(options):
1258
1261
VERBOSE = options .verbose
1259
1262
options .arch = options .arch .split (',' )
1260
1263
options .mode = options .mode .split (',' )
1264
+ if options .J :
1265
+ options .j = multiprocessing .cpu_count ()
1261
1266
def CheckTestMode (name , option ):
1262
1267
if not option in ["run" , "skip" , "dontcare" ]:
1263
1268
print "Unknown %s mode %s" % (name , option )
0 commit comments