| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 return result | 315 return result |
| 316 | 316 |
| 317 | 317 |
| 318 def RandomSeed(): | 318 def RandomSeed(): |
| 319 seed = 0 | 319 seed = 0 |
| 320 while not seed: | 320 while not seed: |
| 321 seed = random.SystemRandom().randint(-2147483648, 2147483647) | 321 seed = random.SystemRandom().randint(-2147483648, 2147483647) |
| 322 return seed | 322 return seed |
| 323 | 323 |
| 324 | 324 |
| 325 def BuildbotToV8Mode(config): |
| 326 """Convert buildbot build configs to configs understood by the v8 runner. |
| 327 |
| 328 V8 configs are always lower case and without the additional _x64 suffix for |
| 329 64 bit builds on windows with ninja. |
| 330 """ |
| 331 mode = config[:-4] if config.endswith('_x64') else config |
| 332 return mode.lower() |
| 333 |
| 325 def ProcessOptions(options): | 334 def ProcessOptions(options): |
| 326 global VARIANT_FLAGS | 335 global VARIANT_FLAGS |
| 327 global VARIANTS | 336 global VARIANTS |
| 328 | 337 |
| 329 # Architecture and mode related stuff. | 338 # Architecture and mode related stuff. |
| 330 if options.arch_and_mode: | 339 if options.arch_and_mode: |
| 331 options.arch_and_mode = [arch_and_mode.split(".") | 340 options.arch_and_mode = [arch_and_mode.split(".") |
| 332 for arch_and_mode in options.arch_and_mode.split(",")] | 341 for arch_and_mode in options.arch_and_mode.split(",")] |
| 333 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) | 342 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) |
| 334 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) | 343 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) |
| 335 options.mode = options.mode.split(",") | 344 options.mode = options.mode.split(",") |
| 336 for mode in options.mode: | 345 for mode in options.mode: |
| 337 if not mode.lower() in MODES: | 346 if not BuildbotToV8Mode(mode) in MODES: |
| 338 print "Unknown mode %s" % mode | 347 print "Unknown mode %s" % mode |
| 339 return False | 348 return False |
| 340 if options.arch in ["auto", "native"]: | 349 if options.arch in ["auto", "native"]: |
| 341 options.arch = ARCH_GUESS | 350 options.arch = ARCH_GUESS |
| 342 options.arch = options.arch.split(",") | 351 options.arch = options.arch.split(",") |
| 343 for arch in options.arch: | 352 for arch in options.arch: |
| 344 if not arch in SUPPORTED_ARCHS: | 353 if not arch in SUPPORTED_ARCHS: |
| 345 print "Unknown architecture %s" % arch | 354 print "Unknown architecture %s" % arch |
| 346 return False | 355 return False |
| 347 | 356 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 533 |
| 525 def Execute(arch, mode, args, options, suites, workspace): | 534 def Execute(arch, mode, args, options, suites, workspace): |
| 526 print(">>> Running tests for %s.%s" % (arch, mode)) | 535 print(">>> Running tests for %s.%s" % (arch, mode)) |
| 527 | 536 |
| 528 shell_dir = options.shell_dir | 537 shell_dir = options.shell_dir |
| 529 if not shell_dir: | 538 if not shell_dir: |
| 530 if options.buildbot: | 539 if options.buildbot: |
| 531 # TODO(machenbach): Get rid of different output folder location on | 540 # TODO(machenbach): Get rid of different output folder location on |
| 532 # buildbot. Currently this is capitalized Release and Debug. | 541 # buildbot. Currently this is capitalized Release and Debug. |
| 533 shell_dir = os.path.join(workspace, options.outdir, mode) | 542 shell_dir = os.path.join(workspace, options.outdir, mode) |
| 534 mode = mode.lower() | 543 mode = BuildbotToV8Mode(mode) |
| 535 else: | 544 else: |
| 536 shell_dir = os.path.join( | 545 shell_dir = os.path.join( |
| 537 workspace, | 546 workspace, |
| 538 options.outdir, | 547 options.outdir, |
| 539 "%s.%s" % (arch, MODES[mode]["output_folder"]), | 548 "%s.%s" % (arch, MODES[mode]["output_folder"]), |
| 540 ) | 549 ) |
| 541 shell_dir = os.path.relpath(shell_dir) | 550 shell_dir = os.path.relpath(shell_dir) |
| 542 | 551 |
| 543 # Populate context object. | 552 # Populate context object. |
| 544 mode_flags = MODES[mode]["flags"] | 553 mode_flags = MODES[mode]["flags"] |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 exit_code = runner.Run(options.j) | 692 exit_code = runner.Run(options.j) |
| 684 overall_duration = time.time() - start_time | 693 overall_duration = time.time() - start_time |
| 685 | 694 |
| 686 if options.time: | 695 if options.time: |
| 687 verbose.PrintTestDurations(suites, overall_duration) | 696 verbose.PrintTestDurations(suites, overall_duration) |
| 688 return exit_code | 697 return exit_code |
| 689 | 698 |
| 690 | 699 |
| 691 if __name__ == "__main__": | 700 if __name__ == "__main__": |
| 692 sys.exit(Main()) | 701 sys.exit(Main()) |
| OLD | NEW |