| 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 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 return False | 1157 return False |
| 1158 return True | 1158 return True |
| 1159 | 1159 |
| 1160 | 1160 |
| 1161 # --------------- | 1161 # --------------- |
| 1162 # --- M a i n --- | 1162 # --- M a i n --- |
| 1163 # --------------- | 1163 # --------------- |
| 1164 | 1164 |
| 1165 | 1165 |
| 1166 ARCH_GUESS = utils.GuessArchitecture() | 1166 ARCH_GUESS = utils.GuessArchitecture() |
| 1167 TIMEOUT_DEFAULT = 60; |
| 1167 | 1168 |
| 1168 | 1169 |
| 1169 def BuildOptions(): | 1170 def BuildOptions(): |
| 1170 result = optparse.OptionParser() | 1171 result = optparse.OptionParser() |
| 1171 result.add_option("-m", "--mode", help="The test modes in which to run (comma-
separated)", | 1172 result.add_option("-m", "--mode", help="The test modes in which to run (comma-
separated)", |
| 1172 default='release') | 1173 default='release') |
| 1173 result.add_option("-v", "--verbose", help="Verbose output", | 1174 result.add_option("-v", "--verbose", help="Verbose output", |
| 1174 default=False, action="store_true") | 1175 default=False, action="store_true") |
| 1175 result.add_option("-S", dest="scons_flags", help="Flag to pass through to scon
s", | 1176 result.add_option("-S", dest="scons_flags", help="Flag to pass through to scon
s", |
| 1176 default=[], action="append") | 1177 default=[], action="append") |
| 1177 result.add_option("-p", "--progress", | 1178 result.add_option("-p", "--progress", |
| 1178 help="The style of progress indicator (verbose, dots, color, mono)", | 1179 help="The style of progress indicator (verbose, dots, color, mono)", |
| 1179 choices=PROGRESS_INDICATORS.keys(), default="mono") | 1180 choices=PROGRESS_INDICATORS.keys(), default="mono") |
| 1180 result.add_option("--no-build", help="Don't build requirements", | 1181 result.add_option("--no-build", help="Don't build requirements", |
| 1181 default=False, action="store_true") | 1182 default=False, action="store_true") |
| 1182 result.add_option("--build-only", help="Only build requirements, don't run the
tests", | 1183 result.add_option("--build-only", help="Only build requirements, don't run the
tests", |
| 1183 default=False, action="store_true") | 1184 default=False, action="store_true") |
| 1184 result.add_option("--build-system", help="Build system in use (scons or gyp)", | 1185 result.add_option("--build-system", help="Build system in use (scons or gyp)", |
| 1185 default='scons') | 1186 default='scons') |
| 1186 result.add_option("--report", help="Print a summary of the tests to be run", | 1187 result.add_option("--report", help="Print a summary of the tests to be run", |
| 1187 default=False, action="store_true") | 1188 default=False, action="store_true") |
| 1188 result.add_option("-s", "--suite", help="A test suite", | 1189 result.add_option("-s", "--suite", help="A test suite", |
| 1189 default=[], action="append") | 1190 default=[], action="append") |
| 1190 result.add_option("-t", "--timeout", help="Timeout in seconds", | 1191 result.add_option("-t", "--timeout", help="Timeout in seconds", |
| 1191 default=60, type="int") | 1192 default=-1, type="int") |
| 1192 result.add_option("--arch", help='The architecture to run tests for', | 1193 result.add_option("--arch", help='The architecture to run tests for', |
| 1193 default='none') | 1194 default='none') |
| 1194 result.add_option("--snapshot", help="Run the tests with snapshot turned on", | 1195 result.add_option("--snapshot", help="Run the tests with snapshot turned on", |
| 1195 default=False, action="store_true") | 1196 default=False, action="store_true") |
| 1196 result.add_option("--simulator", help="Run tests with architecture simulator", | 1197 result.add_option("--simulator", help="Run tests with architecture simulator", |
| 1197 default='none') | 1198 default='none') |
| 1198 result.add_option("--special-command", default=None) | 1199 result.add_option("--special-command", default=None) |
| 1199 result.add_option("--valgrind", help="Run tests through valgrind", | 1200 result.add_option("--valgrind", help="Run tests through valgrind", |
| 1200 default=False, action="store_true") | 1201 default=False, action="store_true") |
| 1201 result.add_option("--cat", help="Print the source of the tests", | 1202 result.add_option("--cat", help="Print the source of the tests", |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 print "Architecture %s does not match sim %s" %(options.arch, options.si
mulator) | 1256 print "Architecture %s does not match sim %s" %(options.arch, options.si
mulator) |
| 1256 return False | 1257 return False |
| 1257 # Ensure that the simulator argument is handed down to scons. | 1258 # Ensure that the simulator argument is handed down to scons. |
| 1258 options.scons_flags.append("simulator=" + options.simulator) | 1259 options.scons_flags.append("simulator=" + options.simulator) |
| 1259 else: | 1260 else: |
| 1260 # If options.arch is not set by the command line and no simulator setting | 1261 # If options.arch is not set by the command line and no simulator setting |
| 1261 # was found, set the arch to the guess. | 1262 # was found, set the arch to the guess. |
| 1262 if options.arch == 'none': | 1263 if options.arch == 'none': |
| 1263 options.arch = ARCH_GUESS | 1264 options.arch = ARCH_GUESS |
| 1264 options.scons_flags.append("arch=" + options.arch) | 1265 options.scons_flags.append("arch=" + options.arch) |
| 1266 # Simulators are slow, therefore allow a longer default timeout. |
| 1267 if options.timeout == -1: |
| 1268 if options.arch == 'arm' or options.arch == 'mips': |
| 1269 options.timeout = 2 * TIMEOUT_DEFAULT; |
| 1270 else: |
| 1271 options.timeout = TIMEOUT_DEFAULT; |
| 1265 if options.snapshot: | 1272 if options.snapshot: |
| 1266 options.scons_flags.append("snapshot=on") | 1273 options.scons_flags.append("snapshot=on") |
| 1267 global VARIANT_FLAGS | 1274 global VARIANT_FLAGS |
| 1268 if options.stress_only: | 1275 if options.stress_only: |
| 1269 VARIANT_FLAGS = [['--stress-opt', '--always-opt']] | 1276 VARIANT_FLAGS = [['--stress-opt', '--always-opt']] |
| 1270 if options.nostress: | 1277 if options.nostress: |
| 1271 VARIANT_FLAGS = [[],['--nocrankshaft']] | 1278 VARIANT_FLAGS = [[],['--nocrankshaft']] |
| 1272 if options.crankshaft: | 1279 if options.crankshaft: |
| 1273 if options.special_command: | 1280 if options.special_command: |
| 1274 options.special_command += " --crankshaft" | 1281 options.special_command += " --crankshaft" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 for entry in timed_tests[:20]: | 1528 for entry in timed_tests[:20]: |
| 1522 t = FormatTime(entry.duration) | 1529 t = FormatTime(entry.duration) |
| 1523 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1530 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
| 1524 index += 1 | 1531 index += 1 |
| 1525 | 1532 |
| 1526 return result | 1533 return result |
| 1527 | 1534 |
| 1528 | 1535 |
| 1529 if __name__ == '__main__': | 1536 if __name__ == '__main__': |
| 1530 sys.exit(Main()) | 1537 sys.exit(Main()) |
| OLD | NEW |