OLD | NEW |
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 Loading... |
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 | |
735 | 732 |
736 class Outcome(Expression): | 733 class Outcome(Expression): |
737 | 734 |
738 def __init__(self, name): | 735 def __init__(self, name): |
739 self.name = name | 736 self.name = name |
740 | 737 |
741 def GetOutcomes(self, env, defs): | 738 def GetOutcomes(self, env, defs): |
742 if self.name in defs: | 739 if self.name in defs: |
743 return defs[self.name].GetOutcomes(env, defs) | 740 return defs[self.name].GetOutcomes(env, defs) |
744 else: | 741 else: |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 dest="store_unexpected_output", default=True, action="store_true") | 1168 dest="store_unexpected_output", default=True, action="store_true") |
1172 result.add_option("--no-store-unexpected-output", | 1169 result.add_option("--no-store-unexpected-output", |
1173 help="Deletes the temporary JS files from tests that fails", | 1170 help="Deletes the temporary JS files from tests that fails", |
1174 dest="store_unexpected_output", action="store_false") | 1171 dest="store_unexpected_output", action="store_false") |
1175 result.add_option("--stress-only", | 1172 result.add_option("--stress-only", |
1176 help="Only run tests with --always-opt --stress-opt", | 1173 help="Only run tests with --always-opt --stress-opt", |
1177 default=False, action="store_true") | 1174 default=False, action="store_true") |
1178 result.add_option("--nostress", | 1175 result.add_option("--nostress", |
1179 help="Don't run crankshaft --always-opt --stress-op test", | 1176 help="Don't run crankshaft --always-opt --stress-op test", |
1180 default=False, action="store_true") | 1177 default=False, action="store_true") |
1181 result.add_option("--crankshaft", | |
1182 help="Run with the --crankshaft flag", | |
1183 default=False, action="store_true") | |
1184 return result | 1178 return result |
1185 | 1179 |
1186 | 1180 |
1187 def ProcessOptions(options): | 1181 def ProcessOptions(options): |
1188 global VERBOSE | 1182 global VERBOSE |
1189 VERBOSE = options.verbose | 1183 VERBOSE = options.verbose |
1190 options.mode = options.mode.split(',') | 1184 options.mode = options.mode.split(',') |
1191 for mode in options.mode: | 1185 for mode in options.mode: |
1192 if not mode in ['debug', 'release']: | 1186 if not mode in ['debug', 'release']: |
1193 print "Unknown mode %s" % mode | 1187 print "Unknown mode %s" % mode |
(...skipping 14 matching lines...) Expand all Loading... |
1208 if options.arch == 'none': | 1202 if options.arch == 'none': |
1209 options.arch = ARCH_GUESS | 1203 options.arch = ARCH_GUESS |
1210 options.scons_flags.append("arch=" + options.arch) | 1204 options.scons_flags.append("arch=" + options.arch) |
1211 if options.snapshot: | 1205 if options.snapshot: |
1212 options.scons_flags.append("snapshot=on") | 1206 options.scons_flags.append("snapshot=on") |
1213 global VARIANT_FLAGS | 1207 global VARIANT_FLAGS |
1214 if options.stress_only: | 1208 if options.stress_only: |
1215 VARIANT_FLAGS = [['--stress-opt', '--always-opt']] | 1209 VARIANT_FLAGS = [['--stress-opt', '--always-opt']] |
1216 if options.nostress: | 1210 if options.nostress: |
1217 VARIANT_FLAGS = [[],['--nocrankshaft']] | 1211 VARIANT_FLAGS = [[],['--nocrankshaft']] |
1218 if options.crankshaft: | |
1219 if options.special_command: | |
1220 options.special_command += " --crankshaft" | |
1221 else: | |
1222 options.special_command = "@--crankshaft" | |
1223 return True | 1212 return True |
1224 | 1213 |
1225 | 1214 |
1226 REPORT_TEMPLATE = """\ | 1215 REPORT_TEMPLATE = """\ |
1227 Total: %(total)i tests | 1216 Total: %(total)i tests |
1228 * %(skipped)4d tests will be skipped | 1217 * %(skipped)4d tests will be skipped |
1229 * %(nocrash)4d tests are expected to be flaky but not crash | 1218 * %(nocrash)4d tests are expected to be flaky but not crash |
1230 * %(pass)4d tests are expected to pass | 1219 * %(pass)4d tests are expected to pass |
1231 * %(fail_ok)4d tests are expected to fail that we won't fix | 1220 * %(fail_ok)4d tests are expected to fail that we won't fix |
1232 * %(fail)4d tests are expected to fail that we should fix\ | 1221 * %(fail)4d tests are expected to fail that we should fix\ |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 globally_unused_rules = None | 1352 globally_unused_rules = None |
1364 for path in paths: | 1353 for path in paths: |
1365 for mode in options.mode: | 1354 for mode in options.mode: |
1366 if not exists(context.GetVm(mode)): | 1355 if not exists(context.GetVm(mode)): |
1367 print "Can't find shell executable: '%s'" % context.GetVm(mode) | 1356 print "Can't find shell executable: '%s'" % context.GetVm(mode) |
1368 continue | 1357 continue |
1369 env = { | 1358 env = { |
1370 'mode': mode, | 1359 'mode': mode, |
1371 'system': utils.GuessOS(), | 1360 'system': utils.GuessOS(), |
1372 'arch': options.arch, | 1361 'arch': options.arch, |
1373 'simulator': options.simulator, | 1362 'simulator': options.simulator |
1374 'crankshaft': options.crankshaft | |
1375 } | 1363 } |
1376 test_list = root.ListTests([], path, context, mode) | 1364 test_list = root.ListTests([], path, context, mode) |
1377 unclassified_tests += test_list | 1365 unclassified_tests += test_list |
1378 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env) | 1366 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env) |
1379 if globally_unused_rules is None: | 1367 if globally_unused_rules is None: |
1380 globally_unused_rules = set(unused_rules) | 1368 globally_unused_rules = set(unused_rules) |
1381 else: | 1369 else: |
1382 globally_unused_rules = globally_unused_rules.intersection(unused_rules) | 1370 globally_unused_rules = globally_unused_rules.intersection(unused_rules) |
1383 all_cases += cases | 1371 all_cases += cases |
1384 all_unused.append(unused_rules) | 1372 all_unused.append(unused_rules) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 for entry in timed_tests[:20]: | 1421 for entry in timed_tests[:20]: |
1434 t = FormatTime(entry.duration) | 1422 t = FormatTime(entry.duration) |
1435 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1423 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
1436 index += 1 | 1424 index += 1 |
1437 | 1425 |
1438 return result | 1426 return result |
1439 | 1427 |
1440 | 1428 |
1441 if __name__ == '__main__': | 1429 if __name__ == '__main__': |
1442 sys.exit(Main()) | 1430 sys.exit(Main()) |
OLD | NEW |