| 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 14 matching lines...) Expand all Loading... |
| 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 | 30 |
| 31 import multiprocessing | 31 import multiprocessing |
| 32 import optparse | 32 import optparse |
| 33 import os | 33 import os |
| 34 from os.path import join | 34 from os.path import join |
| 35 import shlex |
| 35 import subprocess | 36 import subprocess |
| 36 import sys | 37 import sys |
| 37 import time | 38 import time |
| 38 | 39 |
| 39 from testrunner.local import execution | 40 from testrunner.local import execution |
| 40 from testrunner.local import progress | 41 from testrunner.local import progress |
| 41 from testrunner.local import testsuite | 42 from testrunner.local import testsuite |
| 42 from testrunner.local import utils | 43 from testrunner.local import utils |
| 43 from testrunner.local import verbose | 44 from testrunner.local import verbose |
| 44 from testrunner.network import network_execution | 45 from testrunner.network import network_execution |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 # Special processing of other options, sorted alphabetically. | 170 # Special processing of other options, sorted alphabetically. |
| 170 | 171 |
| 171 if options.buildbot: | 172 if options.buildbot: |
| 172 # Buildbots run presubmit tests as a separate step. | 173 # Buildbots run presubmit tests as a separate step. |
| 173 options.no_presubmit = True | 174 options.no_presubmit = True |
| 174 options.no_network = True | 175 options.no_network = True |
| 175 if options.command_prefix: | 176 if options.command_prefix: |
| 176 print("Specifying --command-prefix disables network distribution, " | 177 print("Specifying --command-prefix disables network distribution, " |
| 177 "running tests locally.") | 178 "running tests locally.") |
| 178 options.no_network = True | 179 options.no_network = True |
| 180 options.command_prefix = shlex.split(options.command_prefix) |
| 179 if options.j == 0: | 181 if options.j == 0: |
| 180 options.j = multiprocessing.cpu_count() | 182 options.j = multiprocessing.cpu_count() |
| 181 if options.no_stress: | 183 if options.no_stress: |
| 182 VARIANT_FLAGS = [[], ["--nocrankshaft"]] | 184 VARIANT_FLAGS = [[], ["--nocrankshaft"]] |
| 183 if not options.shell_dir: | 185 if not options.shell_dir: |
| 184 if options.shell: | 186 if options.shell: |
| 185 print "Warning: --shell is deprecated, use --shell-dir instead." | 187 print "Warning: --shell is deprecated, use --shell-dir instead." |
| 186 options.shell_dir = os.path.dirname(options.shell) | 188 options.shell_dir = os.path.dirname(options.shell) |
| 187 if options.stress_only: | 189 if options.stress_only: |
| 188 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] | 190 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] |
| 189 if options.valgrind: | 191 if options.valgrind: |
| 190 run_valgrind = os.path.join("tools", "run-valgrind.py") | 192 run_valgrind = os.path.join("tools", "run-valgrind.py") |
| 191 # This is OK for distributed running, so we don't need to set no_network. | 193 # This is OK for distributed running, so we don't need to set no_network. |
| 192 options.command_prefix = ("python -u " + run_valgrind + | 194 options.command_prefix = (["python", "-u", run_valgrind] + |
| 193 options.command_prefix) | 195 options.command_prefix) |
| 194 return True | 196 return True |
| 195 | 197 |
| 196 | 198 |
| 197 def ShardTests(tests, shard_count, shard_run): | 199 def ShardTests(tests, shard_count, shard_run): |
| 198 if shard_count < 2: | 200 if shard_count < 2: |
| 199 return tests | 201 return tests |
| 200 if shard_run < 1 or shard_run > shard_count: | 202 if shard_run < 1 or shard_run > shard_count: |
| 201 print "shard-run not a valid number, should be in [1:shard-count]" | 203 print "shard-run not a valid number, should be in [1:shard-count]" |
| 202 print "defaulting back to running all tests" | 204 print "defaulting back to running all tests" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 except KeyboardInterrupt: | 362 except KeyboardInterrupt: |
| 361 return 1 | 363 return 1 |
| 362 | 364 |
| 363 if options.time: | 365 if options.time: |
| 364 verbose.PrintTestDurations(suites, overall_duration) | 366 verbose.PrintTestDurations(suites, overall_duration) |
| 365 return exit_code | 367 return exit_code |
| 366 | 368 |
| 367 | 369 |
| 368 if __name__ == "__main__": | 370 if __name__ == "__main__": |
| 369 sys.exit(Main()) | 371 sys.exit(Main()) |
| OLD | NEW |