| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 help="Don't run any testing variants", | 142 help="Don't run any testing variants", |
| 143 default=False, dest="no_variants", action="store_true") | 143 default=False, dest="no_variants", action="store_true") |
| 144 result.add_option("--variants", | 144 result.add_option("--variants", |
| 145 help="Comma-separated list of testing variants") | 145 help="Comma-separated list of testing variants") |
| 146 result.add_option("--outdir", help="Base directory with compile output", | 146 result.add_option("--outdir", help="Base directory with compile output", |
| 147 default="out") | 147 default="out") |
| 148 result.add_option("-p", "--progress", | 148 result.add_option("-p", "--progress", |
| 149 help=("The style of progress indicator" | 149 help=("The style of progress indicator" |
| 150 " (verbose, dots, color, mono)"), | 150 " (verbose, dots, color, mono)"), |
| 151 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") | 151 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") |
| 152 result.add_option("--quickcheck", default=False, action="store_true", |
| 153 help=("Quick check mode (skip slow/flaky tests)")) |
| 152 result.add_option("--report", help="Print a summary of the tests to be run", | 154 result.add_option("--report", help="Print a summary of the tests to be run", |
| 153 default=False, action="store_true") | 155 default=False, action="store_true") |
| 154 result.add_option("--shard-count", | 156 result.add_option("--shard-count", |
| 155 help="Split testsuites into this number of shards", | 157 help="Split testsuites into this number of shards", |
| 156 default=1, type="int") | 158 default=1, type="int") |
| 157 result.add_option("--shard-run", | 159 result.add_option("--shard-run", |
| 158 help="Run this shard from the split up tests.", | 160 help="Run this shard from the split up tests.", |
| 159 default=1, type="int") | 161 default=1, type="int") |
| 160 result.add_option("--shell", help="DEPRECATED! use --shell-dir", default="") | 162 result.add_option("--shell", help="DEPRECATED! use --shell-dir", default="") |
| 161 result.add_option("--shell-dir", help="Directory containing executables", | 163 result.add_option("--shell-dir", help="Directory containing executables", |
| (...skipping 27 matching lines...) Expand all Loading... |
| 189 global VARIANTS | 191 global VARIANTS |
| 190 | 192 |
| 191 # Architecture and mode related stuff. | 193 # Architecture and mode related stuff. |
| 192 if options.arch_and_mode: | 194 if options.arch_and_mode: |
| 193 options.arch_and_mode = [arch_and_mode.split(".") | 195 options.arch_and_mode = [arch_and_mode.split(".") |
| 194 for arch_and_mode in options.arch_and_mode.split(",")] | 196 for arch_and_mode in options.arch_and_mode.split(",")] |
| 195 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) | 197 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) |
| 196 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) | 198 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) |
| 197 options.mode = options.mode.split(",") | 199 options.mode = options.mode.split(",") |
| 198 for mode in options.mode: | 200 for mode in options.mode: |
| 199 if not mode.lower() in ["debug", "release"]: | 201 if not mode.lower() in ["debug", "release", "optdebug"]: |
| 200 print "Unknown mode %s" % mode | 202 print "Unknown mode %s" % mode |
| 201 return False | 203 return False |
| 202 if options.arch in ["auto", "native"]: | 204 if options.arch in ["auto", "native"]: |
| 203 options.arch = ARCH_GUESS | 205 options.arch = ARCH_GUESS |
| 204 options.arch = options.arch.split(",") | 206 options.arch = options.arch.split(",") |
| 205 for arch in options.arch: | 207 for arch in options.arch: |
| 206 if not arch in SUPPORTED_ARCHS: | 208 if not arch in SUPPORTED_ARCHS: |
| 207 print "Unknown architecture %s" % arch | 209 print "Unknown architecture %s" % arch |
| 208 return False | 210 return False |
| 209 | 211 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 225 options.command_prefix = shlex.split(options.command_prefix) | 227 options.command_prefix = shlex.split(options.command_prefix) |
| 226 options.extra_flags = shlex.split(options.extra_flags) | 228 options.extra_flags = shlex.split(options.extra_flags) |
| 227 if options.j == 0: | 229 if options.j == 0: |
| 228 options.j = multiprocessing.cpu_count() | 230 options.j = multiprocessing.cpu_count() |
| 229 | 231 |
| 230 def excl(*args): | 232 def excl(*args): |
| 231 """Returns true if zero or one of multiple arguments are true.""" | 233 """Returns true if zero or one of multiple arguments are true.""" |
| 232 return reduce(lambda x, y: x + y, args) <= 1 | 234 return reduce(lambda x, y: x + y, args) <= 1 |
| 233 | 235 |
| 234 if not excl(options.no_stress, options.stress_only, options.no_variants, | 236 if not excl(options.no_stress, options.stress_only, options.no_variants, |
| 235 bool(options.variants)): | 237 bool(options.variants), options.quickcheck): |
| 236 print("Use only one of --no-stress, --stress-only, --no-variants or " | 238 print("Use only one of --no-stress, --stress-only, --no-variants, " |
| 237 "--variants.") | 239 "--variants, or --quickcheck.") |
| 238 return False | 240 return False |
| 239 if options.no_stress: | 241 if options.no_stress: |
| 240 VARIANTS = ["default", "nocrankshaft"] | 242 VARIANTS = ["default", "nocrankshaft"] |
| 241 if options.no_variants: | 243 if options.no_variants: |
| 242 VARIANTS = ["default"] | 244 VARIANTS = ["default"] |
| 243 if options.stress_only: | 245 if options.stress_only: |
| 244 VARIANTS = ["stress"] | 246 VARIANTS = ["stress"] |
| 245 if options.variants: | 247 if options.variants: |
| 246 VARIANTS = options.variants.split(",") | 248 VARIANTS = options.variants.split(",") |
| 247 if not set(VARIANTS).issubset(VARIANT_FLAGS.keys()): | 249 if not set(VARIANTS).issubset(VARIANT_FLAGS.keys()): |
| 248 print "All variants must be in %s" % str(VARIANT_FLAGS.keys()) | 250 print "All variants must be in %s" % str(VARIANT_FLAGS.keys()) |
| 249 return False | 251 return False |
| 252 if options.quickcheck: |
| 253 VARIANTS = ["default", "stress"] |
| 254 options.flaky_tests = "skip" |
| 255 options.slow_tests = "skip" |
| 256 options.pass_fail_tests = "skip" |
| 257 |
| 250 if not options.shell_dir: | 258 if not options.shell_dir: |
| 251 if options.shell: | 259 if options.shell: |
| 252 print "Warning: --shell is deprecated, use --shell-dir instead." | 260 print "Warning: --shell is deprecated, use --shell-dir instead." |
| 253 options.shell_dir = os.path.dirname(options.shell) | 261 options.shell_dir = os.path.dirname(options.shell) |
| 254 if options.valgrind: | 262 if options.valgrind: |
| 255 run_valgrind = os.path.join("tools", "run-valgrind.py") | 263 run_valgrind = os.path.join("tools", "run-valgrind.py") |
| 256 # This is OK for distributed running, so we don't need to set no_network. | 264 # This is OK for distributed running, so we don't need to set no_network. |
| 257 options.command_prefix = (["python", "-u", run_valgrind] + | 265 options.command_prefix = (["python", "-u", run_valgrind] + |
| 258 options.command_prefix) | 266 options.command_prefix) |
| 259 def CheckTestMode(name, option): | 267 def CheckTestMode(name, option): |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 shell_dir = options.shell_dir | 346 shell_dir = options.shell_dir |
| 339 if not shell_dir: | 347 if not shell_dir: |
| 340 if options.buildbot: | 348 if options.buildbot: |
| 341 shell_dir = os.path.join(workspace, options.outdir, mode) | 349 shell_dir = os.path.join(workspace, options.outdir, mode) |
| 342 mode = mode.lower() | 350 mode = mode.lower() |
| 343 else: | 351 else: |
| 344 shell_dir = os.path.join(workspace, options.outdir, | 352 shell_dir = os.path.join(workspace, options.outdir, |
| 345 "%s.%s" % (arch, mode)) | 353 "%s.%s" % (arch, mode)) |
| 346 shell_dir = os.path.relpath(shell_dir) | 354 shell_dir = os.path.relpath(shell_dir) |
| 347 | 355 |
| 356 if mode == "optdebug": |
| 357 mode = "debug" # "optdebug" is just an alias. |
| 358 |
| 348 # Populate context object. | 359 # Populate context object. |
| 349 mode_flags = MODE_FLAGS[mode] | 360 mode_flags = MODE_FLAGS[mode] |
| 350 timeout = options.timeout | 361 timeout = options.timeout |
| 351 if timeout == -1: | 362 if timeout == -1: |
| 352 # Simulators are slow, therefore allow a longer default timeout. | 363 # Simulators are slow, therefore allow a longer default timeout. |
| 353 if arch in SLOW_ARCHS: | 364 if arch in SLOW_ARCHS: |
| 354 timeout = 2 * TIMEOUT_DEFAULT; | 365 timeout = 2 * TIMEOUT_DEFAULT; |
| 355 else: | 366 else: |
| 356 timeout = TIMEOUT_DEFAULT; | 367 timeout = TIMEOUT_DEFAULT; |
| 357 | 368 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 except KeyboardInterrupt: | 460 except KeyboardInterrupt: |
| 450 return 1 | 461 return 1 |
| 451 | 462 |
| 452 if options.time: | 463 if options.time: |
| 453 verbose.PrintTestDurations(suites, overall_duration) | 464 verbose.PrintTestDurations(suites, overall_duration) |
| 454 return exit_code | 465 return exit_code |
| 455 | 466 |
| 456 | 467 |
| 457 if __name__ == "__main__": | 468 if __name__ == "__main__": |
| 458 sys.exit(Main()) | 469 sys.exit(Main()) |
| OLD | NEW |