| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 if options.j == 0: | 167 if options.j == 0: |
| 168 options.j = multiprocessing.cpu_count() | 168 options.j = multiprocessing.cpu_count() |
| 169 if options.no_stress: | 169 if options.no_stress: |
| 170 VARIANT_FLAGS = [[], ["--nocrankshaft"]] | 170 VARIANT_FLAGS = [[], ["--nocrankshaft"]] |
| 171 if not options.shell_dir: | 171 if not options.shell_dir: |
| 172 if options.shell: | 172 if options.shell: |
| 173 print "Warning: --shell is deprecated, use --shell-dir instead." | 173 print "Warning: --shell is deprecated, use --shell-dir instead." |
| 174 options.shell_dir = os.path.dirname(options.shell) | 174 options.shell_dir = os.path.dirname(options.shell) |
| 175 if options.stress_only: | 175 if options.stress_only: |
| 176 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] | 176 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] |
| 177 # Simulators are slow, therefore allow a longer default timeout. | |
| 178 if options.timeout == -1: | |
| 179 if options.arch == "arm" or options.arch == "mipsel": | |
| 180 options.timeout = 2 * TIMEOUT_DEFAULT; | |
| 181 else: | |
| 182 options.timeout = TIMEOUT_DEFAULT; | |
| 183 if options.valgrind: | 177 if options.valgrind: |
| 184 run_valgrind = os.path.join("tools", "run-valgrind.py") | 178 run_valgrind = os.path.join("tools", "run-valgrind.py") |
| 185 # This is OK for distributed running, so we don't need to set no_network. | 179 # This is OK for distributed running, so we don't need to set no_network. |
| 186 options.command_prefix = ("python -u " + run_valgrind + | 180 options.command_prefix = ("python -u " + run_valgrind + |
| 187 options.command_prefix) | 181 options.command_prefix) |
| 188 return True | 182 return True |
| 189 | 183 |
| 190 | 184 |
| 191 def ShardTests(tests, shard_count, shard_run): | 185 def ShardTests(tests, shard_count, shard_run): |
| 192 if shard_count < 2: | 186 if shard_count < 2: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 if options.buildbot: | 251 if options.buildbot: |
| 258 shell_dir = os.path.join(workspace, options.outdir, mode) | 252 shell_dir = os.path.join(workspace, options.outdir, mode) |
| 259 mode = mode.lower() | 253 mode = mode.lower() |
| 260 else: | 254 else: |
| 261 shell_dir = os.path.join(workspace, options.outdir, | 255 shell_dir = os.path.join(workspace, options.outdir, |
| 262 "%s.%s" % (arch, mode)) | 256 "%s.%s" % (arch, mode)) |
| 263 shell_dir = os.path.relpath(shell_dir) | 257 shell_dir = os.path.relpath(shell_dir) |
| 264 | 258 |
| 265 # Populate context object. | 259 # Populate context object. |
| 266 mode_flags = MODE_FLAGS[mode] | 260 mode_flags = MODE_FLAGS[mode] |
| 261 timeout = options.timeout |
| 262 if timeout == -1: |
| 263 # Simulators are slow, therefore allow a longer default timeout. |
| 264 if arch in ["android", "arm", "mipsel"]: |
| 265 timeout = 2 * TIMEOUT_DEFAULT; |
| 266 else: |
| 267 timeout = TIMEOUT_DEFAULT; |
| 268 |
| 267 options.timeout *= TIMEOUT_SCALEFACTOR[mode] | 269 options.timeout *= TIMEOUT_SCALEFACTOR[mode] |
| 268 ctx = context.Context(arch, mode, shell_dir, | 270 ctx = context.Context(arch, mode, shell_dir, |
| 269 mode_flags, options.verbose, | 271 mode_flags, options.verbose, |
| 270 options.timeout, options.isolates, | 272 timeout, options.isolates, |
| 271 options.command_prefix, | 273 options.command_prefix, |
| 272 options.extra_flags) | 274 options.extra_flags) |
| 273 | 275 |
| 274 # Find available test suites and read test cases from them. | 276 # Find available test suites and read test cases from them. |
| 275 variables = { | 277 variables = { |
| 276 "mode": mode, | 278 "mode": mode, |
| 277 "arch": arch, | 279 "arch": arch, |
| 278 "system": utils.GuessOS(), | 280 "system": utils.GuessOS(), |
| 279 "isolates": options.isolates | 281 "isolates": options.isolates |
| 280 } | 282 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 except KeyboardInterrupt: | 348 except KeyboardInterrupt: |
| 347 return 1 | 349 return 1 |
| 348 | 350 |
| 349 if options.time: | 351 if options.time: |
| 350 verbose.PrintTestDurations(suites, overall_duration) | 352 verbose.PrintTestDurations(suites, overall_duration) |
| 351 return exit_code | 353 return exit_code |
| 352 | 354 |
| 353 | 355 |
| 354 if __name__ == "__main__": | 356 if __name__ == "__main__": |
| 355 sys.exit(Main()) | 357 sys.exit(Main()) |
| OLD | NEW |