| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Dart2js buildbot steps | 7 """Dart2js buildbot steps |
| 8 | 8 |
| 9 Runs tests for the dart2js compiler. | 9 Runs tests for the dart2js compiler. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import platform | 12 import platform |
| 13 import optparse | 13 import optparse |
| 14 import os | 14 import os |
| 15 import re | 15 import re |
| 16 import shutil | 16 import shutil |
| 17 import subprocess | 17 import subprocess |
| 18 import sys | 18 import sys |
| 19 | 19 |
| 20 BUILDER_NAME = 'BUILDBOT_BUILDERNAME' | 20 BUILDER_NAME = 'BUILDBOT_BUILDERNAME' |
| 21 BUILDER_CLOBBER = 'BUILDBOT_CLOBBER' | 21 BUILDER_CLOBBER = 'BUILDBOT_CLOBBER' |
| 22 | 22 |
| 23 | 23 |
| 24 DART_PATH = os.path.dirname( | 24 DART_PATH = os.path.dirname( |
| 25 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 25 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 26 | 26 |
| 27 DART2JS_BUILDER = ( | 27 DART2JS_BUILDER = ( |
| 28 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch
ecked))?(-(host-checked))?-?(\d*)-?(\d*)') | 28 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch
ecked))?(-(host-checked))?-?(\d*)-?(\d*)') |
| 29 WEB_BUILDER = ( | 29 WEB_BUILDER = ( |
| 30 r'dart2js-(ie9|ie10|ff|safari|chrome|opera)-(win7|win8|mac|linux)(-(all|html
))?') | 30 r'dart2js-(ie9|ff|safari|chrome|opera)-(win7|win8|mac|linux)(-(all|html))?') |
| 31 | 31 |
| 32 NO_COLOR_ENV = dict(os.environ) | 32 NO_COLOR_ENV = dict(os.environ) |
| 33 NO_COLOR_ENV['TERM'] = 'nocolor' | 33 NO_COLOR_ENV['TERM'] = 'nocolor' |
| 34 | 34 |
| 35 class BuildInfo(object): | 35 class BuildInfo(object): |
| 36 """ Encapsulation of build information. | 36 """ Encapsulation of build information. |
| 37 - compiler: 'dart2js' or None when the builder has an incorrect name | 37 - compiler: 'dart2js' or None when the builder has an incorrect name |
| 38 - runtime: 'd8', 'ie', 'ff', 'safari', 'chrome', 'opera' | 38 - runtime: 'd8', 'ie', 'ff', 'safari', 'chrome', 'opera' |
| 39 - mode: 'debug' or 'release' | 39 - mode: 'debug' or 'release' |
| 40 - system: 'linux', 'mac', or 'win7' | 40 - system: 'linux', 'mac', or 'win7' |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.' | 101 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.' |
| 102 sys.exit(1) | 102 sys.exit(1) |
| 103 | 103 |
| 104 if builder_name: | 104 if builder_name: |
| 105 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) | 105 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) |
| 106 web_pattern = re.match(WEB_BUILDER, builder_name) | 106 web_pattern = re.match(WEB_BUILDER, builder_name) |
| 107 | 107 |
| 108 if web_pattern: | 108 if web_pattern: |
| 109 compiler = 'dart2js' | 109 compiler = 'dart2js' |
| 110 runtime = web_pattern.group(1) | 110 runtime = web_pattern.group(1) |
| 111 # TODO(efortuna) remove this when new support lands. |
| 112 if runtime == 'ie9': |
| 113 runtime = 'ie' |
| 111 system = web_pattern.group(2) | 114 system = web_pattern.group(2) |
| 112 mode = 'release' | 115 mode = 'release' |
| 113 test_set = web_pattern.group(4) | 116 test_set = web_pattern.group(4) |
| 114 elif dart2js_pattern: | 117 elif dart2js_pattern: |
| 115 compiler = 'dart2js' | 118 compiler = 'dart2js' |
| 116 system = dart2js_pattern.group(1) | 119 system = dart2js_pattern.group(1) |
| 117 runtime = 'd8' | 120 runtime = 'd8' |
| 118 if dart2js_pattern.group(3) == 'jsshell': | 121 if dart2js_pattern.group(3) == 'jsshell': |
| 119 runtime = 'jsshell' | 122 runtime = 'jsshell' |
| 120 mode = dart2js_pattern.group(4) | 123 mode = dart2js_pattern.group(4) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 step_name = TestStepName(name, flags) | 163 step_name = TestStepName(name, flags) |
| 161 print '@@@BUILD_STEP %s@@@' % step_name | 164 print '@@@BUILD_STEP %s@@@' % step_name |
| 162 sys.stdout.flush() | 165 sys.stdout.flush() |
| 163 if NeedsXterm(compiler, runtime) and system == 'linux': | 166 if NeedsXterm(compiler, runtime) and system == 'linux': |
| 164 cmd = ['xvfb-run', '-a'] | 167 cmd = ['xvfb-run', '-a'] |
| 165 else: | 168 else: |
| 166 cmd = [] | 169 cmd = [] |
| 167 | 170 |
| 168 user_test = os.environ.get('USER_TEST', 'no') | 171 user_test = os.environ.get('USER_TEST', 'no') |
| 169 | 172 |
| 173 if runtime == 'ie': |
| 174 runtime = 'ie9' # TODO(efortuna): Fix with issue 6003. |
| 170 cmd.extend([sys.executable, | 175 cmd.extend([sys.executable, |
| 171 os.path.join(os.curdir, 'tools', 'test.py'), | 176 os.path.join(os.curdir, 'tools', 'test.py'), |
| 172 '--step_name=' + step_name, | 177 '--step_name=' + step_name, |
| 173 '--mode=' + mode, | 178 '--mode=' + mode, |
| 174 '--compiler=' + compiler, | 179 '--compiler=' + compiler, |
| 175 '--runtime=' + runtime, | 180 '--runtime=' + runtime, |
| 176 '--time', | 181 '--time', |
| 177 '--use-sdk', | 182 '--use-sdk', |
| 178 '--report']) | 183 '--report']) |
| 179 | 184 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 build_info.is_buildbot, | 409 build_info.is_buildbot, |
| 405 build_info.test_set) | 410 build_info.test_set) |
| 406 | 411 |
| 407 if build_info.runtime != 'd8': CleanUpTemporaryFiles(build_info.system, | 412 if build_info.runtime != 'd8': CleanUpTemporaryFiles(build_info.system, |
| 408 build_info.runtime) | 413 build_info.runtime) |
| 409 if status != 0: print '@@@STEP_FAILURE@@@' | 414 if status != 0: print '@@@STEP_FAILURE@@@' |
| 410 return status | 415 return status |
| 411 | 416 |
| 412 if __name__ == '__main__': | 417 if __name__ == '__main__': |
| 413 sys.exit(main()) | 418 sys.exit(main()) |
| OLD | NEW |