@@ -368,10 +368,11 @@ def __init__(self, exit_code, timed_out, stdout, stderr):
368
368
369
369
class TestCase (object ):
370
370
371
- def __init__ (self , context , path , mode ):
371
+ def __init__ (self , context , path , arch , mode ):
372
372
self .path = path
373
373
self .context = context
374
374
self .duration = None
375
+ self .arch = arch
375
376
self .mode = mode
376
377
377
378
def IsNegative (self ):
@@ -644,9 +645,10 @@ def GetConfiguration(self, context):
644
645
def GetBuildRequirements (self , path , context ):
645
646
return self .GetConfiguration (context ).GetBuildRequirements ()
646
647
647
- def AddTestsToList (self , result , current_path , path , context , mode ):
648
+ def AddTestsToList (self , result , current_path , path , context , arch , mode ):
648
649
for v in VARIANT_FLAGS :
649
- tests = self .GetConfiguration (context ).ListTests (current_path , path , mode )
650
+ tests = self .GetConfiguration (context ).ListTests (current_path , path ,
651
+ arch , mode )
650
652
for t in tests : t .variant_flags = v
651
653
result += tests
652
654
@@ -669,14 +671,14 @@ def GetBuildRequirements(self, path, context):
669
671
result += test .GetBuildRequirements (rest , context )
670
672
return result
671
673
672
- def ListTests (self , current_path , path , context , mode ):
674
+ def ListTests (self , current_path , path , context , arch , mode ):
673
675
(name , rest ) = CarCdr (path )
674
676
result = [ ]
675
677
for test in self .tests :
676
678
test_name = test .GetName ()
677
679
if not name or name .match (test_name ):
678
680
full_path = current_path + [test_name ]
679
- test .AddTestsToList (result , full_path , path , context , mode )
681
+ test .AddTestsToList (result , full_path , path , context , arch , mode )
680
682
result .sort (cmp = lambda a , b : cmp (a .GetName (), b .GetName ()))
681
683
return result
682
684
@@ -708,11 +710,11 @@ def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppr
708
710
self .suppress_dialogs = suppress_dialogs
709
711
self .store_unexpected_output = store_unexpected_output
710
712
711
- def GetVm (self , mode ):
712
- if mode == 'debug ' :
713
- name = 'out/Debug/node'
713
+ def GetVm (self , arch , mode ):
714
+ if arch == 'none ' :
715
+ name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'
714
716
else :
715
- name = 'out/Release /node'
717
+ name = 'out/%s.%s /node' % ( arch , mode )
716
718
717
719
# Currently GYP does not support output_dir for MSVS.
718
720
# http://code.google.com/p/gyp/issues/detail?id=40
@@ -729,9 +731,6 @@ def GetVm(self, mode):
729
731
730
732
return name
731
733
732
- def GetVmCommand (self , testcase , mode ):
733
- return [self .GetVm (mode )] + self .GetVmFlags (testcase , mode )
734
-
735
734
def GetVmFlags (self , testcase , mode ):
736
735
return testcase .variant_flags + FLAGS [mode ]
737
736
@@ -1203,8 +1202,6 @@ def BuildOptions():
1203
1202
default = 'none' )
1204
1203
result .add_option ("--snapshot" , help = "Run the tests with snapshot turned on" ,
1205
1204
default = False , action = "store_true" )
1206
- result .add_option ("--simulator" , help = "Run tests with architecture simulator" ,
1207
- default = 'none' )
1208
1205
result .add_option ("--special-command" , default = None )
1209
1206
result .add_option ("--use-http1" , help = "Pass --use-http1 switch to node" ,
1210
1207
default = False , action = "store_true" )
@@ -1235,29 +1232,8 @@ def BuildOptions():
1235
1232
def ProcessOptions (options ):
1236
1233
global VERBOSE
1237
1234
VERBOSE = options .verbose
1235
+ options .arch = options .arch .split (',' )
1238
1236
options .mode = options .mode .split (',' )
1239
- for mode in options .mode :
1240
- if not mode in ['debug' , 'release' ]:
1241
- print "Unknown mode %s" % mode
1242
- return False
1243
- if options .simulator != 'none' :
1244
- # Simulator argument was set. Make sure arch and simulator agree.
1245
- if options .simulator != options .arch :
1246
- if options .arch == 'none' :
1247
- options .arch = options .simulator
1248
- else :
1249
- print "Architecture %s does not match sim %s" % (options .arch , options .simulator )
1250
- return False
1251
- # Ensure that the simulator argument is handed down to scons.
1252
- options .scons_flags .append ("simulator=" + options .simulator )
1253
- else :
1254
- # If options.arch is not set by the command line and no simulator setting
1255
- # was found, set the arch to the guess.
1256
- if options .arch == 'none' :
1257
- options .arch = ARCH_GUESS
1258
- options .scons_flags .append ("arch=" + options .arch )
1259
- if options .snapshot :
1260
- options .scons_flags .append ("snapshot=on" )
1261
1237
return True
1262
1238
1263
1239
@@ -1415,25 +1391,28 @@ def wrap(processor):
1415
1391
unclassified_tests = [ ]
1416
1392
globally_unused_rules = None
1417
1393
for path in paths :
1418
- for mode in options .mode :
1419
- if not exists (context .GetVm (mode )):
1420
- print "Can't find shell executable: '%s'" % context .GetVm (mode )
1421
- continue
1422
- env = {
1423
- 'mode' : mode ,
1424
- 'system' : utils .GuessOS (),
1425
- 'arch' : options .arch ,
1426
- 'simulator' : options .simulator
1427
- }
1428
- test_list = root .ListTests ([], path , context , mode )
1429
- unclassified_tests += test_list
1430
- (cases , unused_rules , all_outcomes ) = config .ClassifyTests (test_list , env )
1431
- if globally_unused_rules is None :
1432
- globally_unused_rules = set (unused_rules )
1433
- else :
1434
- globally_unused_rules = globally_unused_rules .intersection (unused_rules )
1435
- all_cases += cases
1436
- all_unused .append (unused_rules )
1394
+ for arch in options .arch :
1395
+ for mode in options .mode :
1396
+ vm = context .GetVm (arch , mode )
1397
+ if not exists (vm ):
1398
+ print "Can't find shell executable: '%s'" % vm
1399
+ continue
1400
+ env = {
1401
+ 'mode' : mode ,
1402
+ 'system' : utils .GuessOS (),
1403
+ 'arch' : arch ,
1404
+ }
1405
+ test_list = root .ListTests ([], path , context , arch , mode )
1406
+ unclassified_tests += test_list
1407
+ (cases , unused_rules , all_outcomes ) = (
1408
+ config .ClassifyTests (test_list , env ))
1409
+ if globally_unused_rules is None :
1410
+ globally_unused_rules = set (unused_rules )
1411
+ else :
1412
+ globally_unused_rules = (
1413
+ globally_unused_rules .intersection (unused_rules ))
1414
+ all_cases += cases
1415
+ all_unused .append (unused_rules )
1437
1416
1438
1417
if options .cat :
1439
1418
visited = set ()
0 commit comments