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 """Dart frog buildbot steps | 7 """Dart frog buildbot steps |
ricow1
2012/05/30 09:58:29
remove frog in this comment
| |
8 | 8 |
9 Runs tests for the frog or dart2js compiler. | 9 Runs tests for the frog or dart2js compiler. |
ricow1
2012/05/30 09:58:29
And here
| |
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 | 21 |
22 DART_PATH = os.path.dirname( | 22 DART_PATH = os.path.dirname( |
23 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 23 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
24 | 24 |
25 DART2JS_BUILDER = ( | 25 DART2JS_BUILDER = ( |
26 r'dart2js-(linux|mac|windows)-(debug|release)(-([a-z]+))?-?(\d*)-?(\d*)') | 26 r'dart2js-(linux|mac|windows)-(debug|release)(-([a-z]+))?-?(\d*)-?(\d*)') |
27 FROG_BUILDER = r'(frog)-(linux|mac|windows)-(debug|release)' | 27 FROG_BUILDER = ( |
ricow1
2012/05/30 09:58:29
remove this?
| |
28 WEB_BUILDER = r'web-(ie|ff|safari|chrome|opera)-(win7|win8|mac|linux)(-(\d+))?' | 28 r'(frog)-(linux|mac|windows)-(debug|release)') |
29 WEB_BUILDER = ( | |
30 r'web-(ie|ff|safari|chrome|opera)-(win7|win8|mac|linux)-?(\d*)-?(\d*)') | |
29 | 31 |
30 NO_COLOR_ENV = dict(os.environ) | 32 NO_COLOR_ENV = dict(os.environ) |
31 NO_COLOR_ENV['TERM'] = 'nocolor' | 33 NO_COLOR_ENV['TERM'] = 'nocolor' |
32 | 34 |
33 def GetBuildInfo(): | 35 def GetBuildInfo(): |
34 """Returns a tuple (compiler, runtime, mode, system, option) where: | 36 """Returns a tuple (compiler, runtime, mode, system, option) where: |
35 - compiler: 'dart2js', 'frog', or None when the builder has an | 37 - compiler: 'dart2js', 'frog', or None when the builder has an |
ricow1
2012/05/30 09:58:29
remove frog?
| |
36 incorrect name | 38 incorrect name |
37 - runtime: 'd8', 'ie', 'ff', 'safari', 'chrome', 'opera' | 39 - runtime: 'd8', 'ie', 'ff', 'safari', 'chrome', 'opera' |
38 - mode: 'debug' or 'release' | 40 - mode: 'debug' or 'release' |
39 - system: 'linux', 'mac', or 'win7' | 41 - system: 'linux', 'mac', or 'win7' |
40 - option: 'checked' | 42 - option: 'checked' |
41 """ | 43 """ |
42 parser = optparse.OptionParser() | 44 parser = optparse.OptionParser() |
43 parser.add_option('-n', '--name', dest='name', help='The name of the build' | 45 parser.add_option('-n', '--name', dest='name', help='The name of the build' |
44 'bot you would like to emulate (ex: web-chrome-win7)', default=None) | 46 'bot you would like to emulate (ex: web-chrome-win7)', default=None) |
45 args, _ = parser.parse_args() | 47 args, _ = parser.parse_args() |
(...skipping 21 matching lines...) Expand all Loading... | |
67 | 69 |
68 if dart2js_pattern: | 70 if dart2js_pattern: |
69 compiler = 'dart2js' | 71 compiler = 'dart2js' |
70 runtime = 'd8' | 72 runtime = 'd8' |
71 system = dart2js_pattern.group(1) | 73 system = dart2js_pattern.group(1) |
72 mode = dart2js_pattern.group(2) | 74 mode = dart2js_pattern.group(2) |
73 option = dart2js_pattern.group(4) | 75 option = dart2js_pattern.group(4) |
74 shard_index = dart2js_pattern.group(5) | 76 shard_index = dart2js_pattern.group(5) |
75 total_shards = dart2js_pattern.group(6) | 77 total_shards = dart2js_pattern.group(6) |
76 | 78 |
77 elif frog_pattern: | 79 elif frog_pattern: |
ricow1
2012/05/30 09:58:29
remove this?
| |
78 compiler = frog_pattern.group(1) | 80 compiler = frog_pattern.group(1) |
79 runtime = 'd8' | 81 runtime = 'd8' |
80 system = frog_pattern.group(2) | 82 system = frog_pattern.group(2) |
81 mode = frog_pattern.group(3) | 83 mode = frog_pattern.group(3) |
82 | 84 |
83 elif web_pattern: | 85 elif web_pattern: |
84 compiler = 'dart2js' | 86 compiler = 'dart2js' |
85 runtime = web_pattern.group(1) | 87 runtime = web_pattern.group(1) |
88 system = web_pattern.group(2) | |
86 mode = 'release' | 89 mode = 'release' |
87 system = web_pattern.group(2) | 90 shard_index = dart2js_pattern.group(3) |
88 | 91 total_shards = dart2js_pattern.group(4) |
89 # TODO(kasperl): Update the names of the web builders so we can | |
90 # use the generic sharding mechanism. | |
91 if (runtime == 'ie'): | |
92 total_shards = 2 | |
93 if web_pattern.group(4) == '2': shard_index = 2 | |
94 else: shard_index = 1 | |
95 | 92 |
96 if system == 'windows': | 93 if system == 'windows': |
97 system = 'win7' | 94 system = 'win7' |
98 | 95 |
99 if (system == 'win7' and platform.system() != 'Windows') or ( | 96 if (system == 'win7' and platform.system() != 'Windows') or ( |
100 system == 'mac' and platform.system() != 'Darwin') or ( | 97 system == 'mac' and platform.system() != 'Darwin') or ( |
101 system == 'linux' and platform.system() != 'Linux'): | 98 system == 'linux' and platform.system() != 'Linux'): |
102 print ('Error: You cannot emulate a buildbot with a platform different ' | 99 print ('Error: You cannot emulate a buildbot with a platform different ' |
103 'from your own.') | 100 'from your own.') |
104 sys.exit(1) | 101 sys.exit(1) |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 # that run the browser tests to cut down on the cycle time. | 199 # that run the browser tests to cut down on the cycle time. |
203 TestStep("dart2js_unit", mode, system, 'none', 'vm', ['leg'], flags) | 200 TestStep("dart2js_unit", mode, system, 'none', 'vm', ['leg'], flags) |
204 | 201 |
205 # Run the default set of test suites. | 202 # Run the default set of test suites. |
206 TestStep("dart2js", mode, system, 'dart2js', runtime, [], flags) | 203 TestStep("dart2js", mode, system, 'dart2js', runtime, [], flags) |
207 | 204 |
208 # TODO(kasperl): Consider running peg and css tests too. | 205 # TODO(kasperl): Consider running peg and css tests too. |
209 extras = ['leg_only', 'frog_native'] | 206 extras = ['leg_only', 'frog_native'] |
210 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extras, flags) | 207 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extras, flags) |
211 | 208 |
212 elif compiler == 'frog': | 209 elif compiler == 'frog': |
ricow1
2012/05/30 09:58:29
remove this?
| |
213 TestStep("frog", mode, system, compiler, runtime, [], flags) | 210 TestStep("frog", mode, system, compiler, runtime, [], flags) |
214 extras = ['frog', 'frog_native', 'peg', 'css'] | 211 extras = ['frog', 'frog_native', 'peg', 'css'] |
215 TestStep("frog_extra", mode, system, compiler, runtime, extras, flags) | 212 TestStep("frog_extra", mode, system, compiler, runtime, extras, flags) |
216 | 213 |
217 return 0 | 214 return 0 |
218 | 215 |
219 def _DeleteFirefoxProfiles(directory): | 216 def _DeleteFirefoxProfiles(directory): |
220 """Find all the firefox profiles in a particular directory and delete them.""" | 217 """Find all the firefox profiles in a particular directory and delete them.""" |
221 for f in os.listdir(directory): | 218 for f in os.listdir(directory): |
222 item = os.path.join(directory, f) | 219 item = os.path.join(directory, f) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 if status == 0 and compiler != 'dart2js': | 281 if status == 0 and compiler != 'dart2js': |
285 status = TestCompiler(compiler, runtime, mode, system, option, | 282 status = TestCompiler(compiler, runtime, mode, system, option, |
286 test_flags + ['--checked']) | 283 test_flags + ['--checked']) |
287 | 284 |
288 if runtime != 'd8': CleanUpTemporaryFiles(system, runtime) | 285 if runtime != 'd8': CleanUpTemporaryFiles(system, runtime) |
289 if status != 0: print '@@@STEP_FAILURE@@@' | 286 if status != 0: print '@@@STEP_FAILURE@@@' |
290 return status | 287 return status |
291 | 288 |
292 if __name__ == '__main__': | 289 if __name__ == '__main__': |
293 sys.exit(main()) | 290 sys.exit(main()) |
OLD | NEW |