| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 Dart2js buildbot steps | 8 Dart2js buildbot steps |
| 9 | 9 |
| 10 Runs tests for the dart2js compiler. | 10 Runs tests for the dart2js compiler. |
| 11 """ | 11 """ |
| 12 | 12 |
| 13 import platform | 13 import platform |
| 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 import bot | 20 import bot |
| 21 | 21 |
| 22 DART2JS_BUILDER = ( | 22 DART2JS_BUILDER = ( |
| 23 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch
ecked))?(-(host-checked))?(-(minified))?(-(csp))?-?(\d*)-?(\d*)') | 23 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch
ecked))?(-(host-checked))?(-(minified))?-?(\d*)-?(\d*)') |
| 24 WEB_BUILDER = ( | 24 WEB_BUILDER = ( |
| 25 r'dart2js-(ie9|ie10|ff|safari|chrome|opera)-(win7|win8|mac10\.8|mac10\.7|lin
ux)(-(all|html))?(-(\d+)-(\d+))?') | 25 r'dart2js-(ie9|ie10|ff|safari|chrome|opera)-(win7|win8|mac10\.8|mac10\.7|lin
ux)(-(all|html))?(-(csp))?(-(\d+)-(\d+))?') |
| 26 | 26 |
| 27 | 27 |
| 28 def GetBuildInfo(builder_name, is_buildbot): | 28 def GetBuildInfo(builder_name, is_buildbot): |
| 29 """Returns a BuildInfo object for the current buildbot based on the | 29 """Returns a BuildInfo object for the current buildbot based on the |
| 30 name of the builder. | 30 name of the builder. |
| 31 """ | 31 """ |
| 32 compiler = None | 32 compiler = None |
| 33 runtime = None | 33 runtime = None |
| 34 mode = None | 34 mode = None |
| 35 system = None | 35 system = None |
| 36 checked = False | 36 checked = False |
| 37 host_checked = False | 37 host_checked = False |
| 38 minified = False | 38 minified = False |
| 39 shard_index = None | 39 shard_index = None |
| 40 total_shards = None | 40 total_shards = None |
| 41 test_set = None | 41 test_set = None |
| 42 csp = None | 42 csp = None |
| 43 | 43 |
| 44 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) | 44 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) |
| 45 web_pattern = re.match(WEB_BUILDER, builder_name) | 45 web_pattern = re.match(WEB_BUILDER, builder_name) |
| 46 | 46 |
| 47 if web_pattern: | 47 if web_pattern: |
| 48 compiler = 'dart2js' | 48 compiler = 'dart2js' |
| 49 runtime = web_pattern.group(1) | 49 runtime = web_pattern.group(1) |
| 50 system = web_pattern.group(2) | 50 system = web_pattern.group(2) |
| 51 mode = 'release' | 51 mode = 'release' |
| 52 test_set = web_pattern.group(4) | 52 test_set = web_pattern.group(4) |
| 53 shard_index = web_pattern.group(6) | 53 if dart2js_pattern.group(6) == 'csp': |
| 54 total_shards = web_pattern.group(7) | 54 csp = True |
| 55 shard_index = web_pattern.group(8) |
| 56 total_shards = web_pattern.group(9) |
| 55 elif dart2js_pattern: | 57 elif dart2js_pattern: |
| 56 compiler = 'dart2js' | 58 compiler = 'dart2js' |
| 57 system = dart2js_pattern.group(1) | 59 system = dart2js_pattern.group(1) |
| 58 runtime = 'd8' | 60 runtime = 'd8' |
| 59 if dart2js_pattern.group(3) == 'jsshell': | 61 if dart2js_pattern.group(3) == 'jsshell': |
| 60 runtime = 'jsshell' | 62 runtime = 'jsshell' |
| 61 mode = dart2js_pattern.group(4) | 63 mode = dart2js_pattern.group(4) |
| 62 # The valid naming parts for checked and host-checked are: | 64 # The valid naming parts for checked and host-checked are: |
| 63 # Empty: checked=False, host_checked=False | 65 # Empty: checked=False, host_checked=False |
| 64 # -checked: checked=True, host_checked=False | 66 # -checked: checked=True, host_checked=False |
| 65 # -host-checked: checked=False, host_checked=True | 67 # -host-checked: checked=False, host_checked=True |
| 66 # -checked-host-checked: checked=True, host_checked=True | 68 # -checked-host-checked: checked=True, host_checked=True |
| 67 if dart2js_pattern.group(6) == 'checked': | 69 if dart2js_pattern.group(6) == 'checked': |
| 68 checked = True | 70 checked = True |
| 69 if dart2js_pattern.group(6) == 'host-checked': | 71 if dart2js_pattern.group(6) == 'host-checked': |
| 70 host_checked = True | 72 host_checked = True |
| 71 if dart2js_pattern.group(8) == 'host-checked': | 73 if dart2js_pattern.group(8) == 'host-checked': |
| 72 host_checked = True | 74 host_checked = True |
| 73 if dart2js_pattern.group(10) == 'minified': | 75 if dart2js_pattern.group(10) == 'minified': |
| 74 minified = True | 76 minified = True |
| 75 if dart2js_pattern.group(12) == 'csp': | 77 shard_index = dart2js_pattern.group(11) |
| 76 csp = True | 78 total_shards = dart2js_pattern.group(12) |
| 77 shard_index = dart2js_pattern.group(13) | |
| 78 total_shards = dart2js_pattern.group(14) | |
| 79 else : | 79 else : |
| 80 return None | 80 return None |
| 81 | 81 |
| 82 if system == 'windows': | 82 if system == 'windows': |
| 83 system = 'win7' | 83 system = 'win7' |
| 84 | 84 |
| 85 # We have both 10.8 and 10.7 bots, functionality is the same. | 85 # We have both 10.8 and 10.7 bots, functionality is the same. |
| 86 if system == 'mac10.8' or system == 'mac10.7': | 86 if system == 'mac10.8' or system == 'mac10.7': |
| 87 system = 'mac' | 87 system = 'mac' |
| 88 | 88 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 """ | 321 """ |
| 322 with bot.BuildStep('Build SDK and d8'): | 322 with bot.BuildStep('Build SDK and d8'): |
| 323 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, | 323 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, |
| 324 'dart2js_bot'] | 324 'dart2js_bot'] |
| 325 print 'Build SDK and d8: %s' % (' '.join(args)) | 325 print 'Build SDK and d8: %s' % (' '.join(args)) |
| 326 bot.RunProcess(args) | 326 bot.RunProcess(args) |
| 327 | 327 |
| 328 | 328 |
| 329 if __name__ == '__main__': | 329 if __name__ == '__main__': |
| 330 bot.RunBot(GetBuildInfo, RunCompilerTests, build_step=BuildCompiler) | 330 bot.RunBot(GetBuildInfo, RunCompilerTests, build_step=BuildCompiler) |
| OLD | NEW |