| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 import bot | 10 import bot |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 raise Exception("Invalid annotated steps run") | 63 raise Exception("Invalid annotated steps run") |
| 64 finally: | 64 finally: |
| 65 for path in temporary_files: | 65 for path in temporary_files: |
| 66 if os.path.exists(path): | 66 if os.path.exists(path): |
| 67 os.remove(path) | 67 os.remove(path) |
| 68 | 68 |
| 69 def target_builder(arch, mode): | 69 def target_builder(arch, mode): |
| 70 test_py = os.path.join('tools', 'test.py') | 70 test_py = os.path.join('tools', 'test.py') |
| 71 test_args = [sys.executable, test_py, '--progress=line', '--report', | 71 test_args = [sys.executable, test_py, '--progress=line', '--report', |
| 72 '--time', '--compiler=none', '--runtime=vm', '--write-debug-log', | 72 '--time', '--compiler=none', '--runtime=vm', '--write-debug-log', |
| 73 '--mode=' + mode, '--arch=' + arch] | 73 '--write-test-outcome-log', '--mode=' + mode, '--arch=' + arch] |
| 74 | 74 |
| 75 revision = int(os.environ['BUILDBOT_GOT_REVISION']) | 75 revision = int(os.environ['BUILDBOT_GOT_REVISION']) |
| 76 tarball = tarball_name(arch, mode, revision) | 76 tarball = tarball_name(arch, mode, revision) |
| 77 temporary_files = [tarball] | 77 temporary_files = [tarball] |
| 78 bot.Clobber() | 78 bot.Clobber() |
| 79 try: | 79 try: |
| 80 with bot.BuildStep('Fetch build tarball'): | 80 with bot.BuildStep('Fetch build tarball'): |
| 81 run([GSUTIL, 'cp', "%s/%s" % (GCS_BUCKET, tarball), tarball]) | 81 run([GSUTIL, 'cp', "%s/%s" % (GCS_BUCKET, tarball), tarball]) |
| 82 | 82 |
| 83 with bot.BuildStep('Unpack build tarball'): | 83 with bot.BuildStep('Unpack build tarball'): |
| 84 run(['tar', '-xjf', tarball]) | 84 run(['tar', '-xjf', tarball]) |
| 85 | 85 |
| 86 with bot.BuildStep('execute tests'): | 86 with bot.BuildStep('execute tests'): |
| 87 run(test_args) | 87 run(test_args) |
| 88 | 88 |
| 89 with bot.BuildStep('execute checked_tests'): | 89 with bot.BuildStep('execute checked_tests'): |
| 90 run(test_args + ['--checked']) | 90 run(test_args + ['--checked', '--append_logs') |
| 91 finally: | 91 finally: |
| 92 for path in temporary_files: | 92 for path in temporary_files: |
| 93 if os.path.exists(path): | 93 if os.path.exists(path): |
| 94 os.remove(path) | 94 os.remove(path) |
| 95 | 95 |
| 96 def main(): | 96 def main(): |
| 97 name, is_buildbot = bot.GetBotName() | 97 name, is_buildbot = bot.GetBotName() |
| 98 | 98 |
| 99 cross_vm_pattern_match = re.match(CROSS_VM, name) | 99 cross_vm_pattern_match = re.match(CROSS_VM, name) |
| 100 target_vm_pattern_match = re.match(TARGET_VM, name) | 100 target_vm_pattern_match = re.match(TARGET_VM, name) |
| 101 if cross_vm_pattern_match: | 101 if cross_vm_pattern_match: |
| 102 arch = cross_vm_pattern_match.group(1) | 102 arch = cross_vm_pattern_match.group(1) |
| 103 mode = cross_vm_pattern_match.group(2) | 103 mode = cross_vm_pattern_match.group(2) |
| 104 cross_compiling_builder(arch, mode) | 104 cross_compiling_builder(arch, mode) |
| 105 elif target_vm_pattern_match: | 105 elif target_vm_pattern_match: |
| 106 arch = target_vm_pattern_match.group(1) | 106 arch = target_vm_pattern_match.group(1) |
| 107 mode = target_vm_pattern_match.group(2) | 107 mode = target_vm_pattern_match.group(2) |
| 108 target_builder(arch, mode) | 108 target_builder(arch, mode) |
| 109 else: | 109 else: |
| 110 raise Exception("Unknown builder name %s" % name) | 110 raise Exception("Unknown builder name %s" % name) |
| 111 | 111 |
| 112 if __name__ == '__main__': | 112 if __name__ == '__main__': |
| 113 try: | 113 try: |
| 114 sys.exit(main()) | 114 sys.exit(main()) |
| 115 except OSError as e: | 115 except OSError as e: |
| 116 sys.exit(e.errno) | 116 sys.exit(e.errno) |
| OLD | NEW |