Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: tools/test.py

Issue 5787001: Change test script to make it easy to run crankshaft tests on ARM and... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2008 the V8 project authors. All rights reserved. 3 # Copyright 2008 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 722
723 class Variable(Expression): 723 class Variable(Expression):
724 724
725 def __init__(self, name): 725 def __init__(self, name):
726 self.name = name 726 self.name = name
727 727
728 def GetOutcomes(self, env, defs): 728 def GetOutcomes(self, env, defs):
729 if self.name in env: return ListSet([env[self.name]]) 729 if self.name in env: return ListSet([env[self.name]])
730 else: return Nothing() 730 else: return Nothing()
731 731
732 def Evaluate(self, env, defs):
733 return env[self.name]
734
732 735
733 class Outcome(Expression): 736 class Outcome(Expression):
734 737
735 def __init__(self, name): 738 def __init__(self, name):
736 self.name = name 739 self.name = name
737 740
738 def GetOutcomes(self, env, defs): 741 def GetOutcomes(self, env, defs):
739 if self.name in defs: 742 if self.name in defs:
740 return defs[self.name].GetOutcomes(env, defs) 743 return defs[self.name].GetOutcomes(env, defs)
741 else: 744 else:
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 dest="store_unexpected_output", default=True, action="store_true") 1171 dest="store_unexpected_output", default=True, action="store_true")
1169 result.add_option("--no-store-unexpected-output", 1172 result.add_option("--no-store-unexpected-output",
1170 help="Deletes the temporary JS files from tests that fails", 1173 help="Deletes the temporary JS files from tests that fails",
1171 dest="store_unexpected_output", action="store_false") 1174 dest="store_unexpected_output", action="store_false")
1172 result.add_option("--stress-only", 1175 result.add_option("--stress-only",
1173 help="Only run tests with --always-opt --stress-opt", 1176 help="Only run tests with --always-opt --stress-opt",
1174 default=False, action="store_true") 1177 default=False, action="store_true")
1175 result.add_option("--nostress", 1178 result.add_option("--nostress",
1176 help="Don't run crankshaft --always-opt --stress-op test", 1179 help="Don't run crankshaft --always-opt --stress-op test",
1177 default=False, action="store_true") 1180 default=False, action="store_true")
1181 result.add_option("--crankshaft",
1182 help="Run with the --crankshaft flag",
1183 default=False, action="store_true")
1178 return result 1184 return result
1179 1185
1180 1186
1181 def ProcessOptions(options): 1187 def ProcessOptions(options):
1182 global VERBOSE 1188 global VERBOSE
1183 VERBOSE = options.verbose 1189 VERBOSE = options.verbose
1184 options.mode = options.mode.split(',') 1190 options.mode = options.mode.split(',')
1185 for mode in options.mode: 1191 for mode in options.mode:
1186 if not mode in ['debug', 'release']: 1192 if not mode in ['debug', 'release']:
1187 print "Unknown mode %s" % mode 1193 print "Unknown mode %s" % mode
(...skipping 14 matching lines...) Expand all
1202 if options.arch == 'none': 1208 if options.arch == 'none':
1203 options.arch = ARCH_GUESS 1209 options.arch = ARCH_GUESS
1204 options.scons_flags.append("arch=" + options.arch) 1210 options.scons_flags.append("arch=" + options.arch)
1205 if options.snapshot: 1211 if options.snapshot:
1206 options.scons_flags.append("snapshot=on") 1212 options.scons_flags.append("snapshot=on")
1207 global VARIANT_FLAGS 1213 global VARIANT_FLAGS
1208 if options.stress_only: 1214 if options.stress_only:
1209 VARIANT_FLAGS = [['--stress-opt', '--always-opt']] 1215 VARIANT_FLAGS = [['--stress-opt', '--always-opt']]
1210 if options.nostress: 1216 if options.nostress:
1211 VARIANT_FLAGS = [[],['--nocrankshaft']] 1217 VARIANT_FLAGS = [[],['--nocrankshaft']]
1218 if options.crankshaft:
1219 if options.special_command:
1220 options.special_command += " --crankshaft"
1221 else:
1222 options.special_command = "@--crankshaft"
1212 return True 1223 return True
1213 1224
1214 1225
1215 REPORT_TEMPLATE = """\ 1226 REPORT_TEMPLATE = """\
1216 Total: %(total)i tests 1227 Total: %(total)i tests
1217 * %(skipped)4d tests will be skipped 1228 * %(skipped)4d tests will be skipped
1218 * %(nocrash)4d tests are expected to be flaky but not crash 1229 * %(nocrash)4d tests are expected to be flaky but not crash
1219 * %(pass)4d tests are expected to pass 1230 * %(pass)4d tests are expected to pass
1220 * %(fail_ok)4d tests are expected to fail that we won't fix 1231 * %(fail_ok)4d tests are expected to fail that we won't fix
1221 * %(fail)4d tests are expected to fail that we should fix\ 1232 * %(fail)4d tests are expected to fail that we should fix\
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 globally_unused_rules = None 1363 globally_unused_rules = None
1353 for path in paths: 1364 for path in paths:
1354 for mode in options.mode: 1365 for mode in options.mode:
1355 if not exists(context.GetVm(mode)): 1366 if not exists(context.GetVm(mode)):
1356 print "Can't find shell executable: '%s'" % context.GetVm(mode) 1367 print "Can't find shell executable: '%s'" % context.GetVm(mode)
1357 continue 1368 continue
1358 env = { 1369 env = {
1359 'mode': mode, 1370 'mode': mode,
1360 'system': utils.GuessOS(), 1371 'system': utils.GuessOS(),
1361 'arch': options.arch, 1372 'arch': options.arch,
1362 'simulator': options.simulator 1373 'simulator': options.simulator,
1374 'crankshaft': options.crankshaft
1363 } 1375 }
1364 test_list = root.ListTests([], path, context, mode) 1376 test_list = root.ListTests([], path, context, mode)
1365 unclassified_tests += test_list 1377 unclassified_tests += test_list
1366 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env) 1378 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env)
1367 if globally_unused_rules is None: 1379 if globally_unused_rules is None:
1368 globally_unused_rules = set(unused_rules) 1380 globally_unused_rules = set(unused_rules)
1369 else: 1381 else:
1370 globally_unused_rules = globally_unused_rules.intersection(unused_rules) 1382 globally_unused_rules = globally_unused_rules.intersection(unused_rules)
1371 all_cases += cases 1383 all_cases += cases
1372 all_unused.append(unused_rules) 1384 all_unused.append(unused_rules)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 for entry in timed_tests[:20]: 1433 for entry in timed_tests[:20]:
1422 t = FormatTime(entry.duration) 1434 t = FormatTime(entry.duration)
1423 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) 1435 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
1424 index += 1 1436 index += 1
1425 1437
1426 return result 1438 return result
1427 1439
1428 1440
1429 if __name__ == '__main__': 1441 if __name__ == '__main__':
1430 sys.exit(Main()) 1442 sys.exit(Main())
OLDNEW
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698