@@ -368,10 +368,11 @@ def __init__(self, exit_code, timed_out, stdout, stderr):
368368
369369class TestCase (object ):
370370
371- def __init__ (self , context , path , mode ):
371+ def __init__ (self , context , path , arch , mode ):
372372 self .path = path
373373 self .context = context
374374 self .duration = None
375+ self .arch = arch
375376 self .mode = mode
376377
377378 def IsNegative (self ):
@@ -644,9 +645,10 @@ def GetConfiguration(self, context):
644645 def GetBuildRequirements (self , path , context ):
645646 return self .GetConfiguration (context ).GetBuildRequirements ()
646647
647- def AddTestsToList (self , result , current_path , path , context , mode ):
648+ def AddTestsToList (self , result , current_path , path , context , arch , mode ):
648649 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 )
650652 for t in tests : t .variant_flags = v
651653 result += tests
652654
@@ -669,14 +671,14 @@ def GetBuildRequirements(self, path, context):
669671 result += test .GetBuildRequirements (rest , context )
670672 return result
671673
672- def ListTests (self , current_path , path , context , mode ):
674+ def ListTests (self , current_path , path , context , arch , mode ):
673675 (name , rest ) = CarCdr (path )
674676 result = [ ]
675677 for test in self .tests :
676678 test_name = test .GetName ()
677679 if not name or name .match (test_name ):
678680 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 )
680682 result .sort (cmp = lambda a , b : cmp (a .GetName (), b .GetName ()))
681683 return result
682684
@@ -708,11 +710,11 @@ def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppr
708710 self .suppress_dialogs = suppress_dialogs
709711 self .store_unexpected_output = store_unexpected_output
710712
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'
714716 else :
715- name = 'out/Release /node'
717+ name = 'out/%s.%s /node' % ( arch , mode )
716718
717719 # Currently GYP does not support output_dir for MSVS.
718720 # http://code.google.com/p/gyp/issues/detail?id=40
@@ -729,9 +731,6 @@ def GetVm(self, mode):
729731
730732 return name
731733
732- def GetVmCommand (self , testcase , mode ):
733- return [self .GetVm (mode )] + self .GetVmFlags (testcase , mode )
734-
735734 def GetVmFlags (self , testcase , mode ):
736735 return testcase .variant_flags + FLAGS [mode ]
737736
@@ -1203,8 +1202,6 @@ def BuildOptions():
12031202 default = 'none' )
12041203 result .add_option ("--snapshot" , help = "Run the tests with snapshot turned on" ,
12051204 default = False , action = "store_true" )
1206- result .add_option ("--simulator" , help = "Run tests with architecture simulator" ,
1207- default = 'none' )
12081205 result .add_option ("--special-command" , default = None )
12091206 result .add_option ("--use-http1" , help = "Pass --use-http1 switch to node" ,
12101207 default = False , action = "store_true" )
@@ -1235,29 +1232,8 @@ def BuildOptions():
12351232def ProcessOptions (options ):
12361233 global VERBOSE
12371234 VERBOSE = options .verbose
1235+ options .arch = options .arch .split (',' )
12381236 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" )
12611237 return True
12621238
12631239
@@ -1415,25 +1391,28 @@ def wrap(processor):
14151391 unclassified_tests = [ ]
14161392 globally_unused_rules = None
14171393 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 )
14371416
14381417 if options .cat :
14391418 visited = set ()
0 commit comments