Chromium Code Reviews| 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 Shared code for use in the buildbot scripts. | 8 Shared code for use in the buildbot scripts. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 - runtime: 'd8', 'ie', 'ff', 'safari', 'chrome', 'opera', or None. | 29 - runtime: 'd8', 'ie', 'ff', 'safari', 'chrome', 'opera', or None. |
| 30 - mode: 'debug' or 'release'. | 30 - mode: 'debug' or 'release'. |
| 31 - system: 'linux', 'mac', or 'win7'. | 31 - system: 'linux', 'mac', or 'win7'. |
| 32 - checked: True if we should run in checked mode, otherwise False. | 32 - checked: True if we should run in checked mode, otherwise False. |
| 33 - host_checked: True if we should run in host checked mode, otherwise False. | 33 - host_checked: True if we should run in host checked mode, otherwise False. |
| 34 - minified: True if we should minify the code, otherwise False | 34 - minified: True if we should minify the code, otherwise False |
| 35 - shard_index: The shard we are running, None when not specified. | 35 - shard_index: The shard we are running, None when not specified. |
| 36 - total_shards: The total number of shards, None when not specified. | 36 - total_shards: The total number of shards, None when not specified. |
| 37 - is_buildbot: True if we are on a buildbot (or emulating it). | 37 - is_buildbot: True if we are on a buildbot (or emulating it). |
| 38 - test_set: Specification of a non standard test set or None. | 38 - test_set: Specification of a non standard test set or None. |
| 39 - csp: This is using csp when running | |
| 40 - arch: The architecture to build on. | |
| 39 """ | 41 """ |
| 40 def __init__(self, compiler, runtime, mode, system, checked=False, | 42 def __init__(self, compiler, runtime, mode, system, checked=False, |
| 41 host_checked=False, minified=False, shard_index=None, | 43 host_checked=False, minified=False, shard_index=None, |
| 42 total_shards=None, is_buildbot=False, test_set=None, | 44 total_shards=None, is_buildbot=False, test_set=None, |
| 43 csp=None): | 45 csp=None, arch=None): |
| 44 self.compiler = compiler | 46 self.compiler = compiler |
| 45 self.runtime = runtime | 47 self.runtime = runtime |
| 46 self.mode = mode | 48 self.mode = mode |
| 47 self.system = system | 49 self.system = system |
| 48 self.checked = checked | 50 self.checked = checked |
| 49 self.host_checked = host_checked | 51 self.host_checked = host_checked |
| 50 self.minified = minified | 52 self.minified = minified |
| 51 self.shard_index = shard_index | 53 self.shard_index = shard_index |
| 52 self.total_shards = total_shards | 54 self.total_shards = total_shards |
| 53 self.is_buildbot = is_buildbot | 55 self.is_buildbot = is_buildbot |
| 54 self.test_set = test_set | 56 self.test_set = test_set |
| 55 self.csp = csp | 57 self.csp = csp |
| 58 if (arch == None): | |
| 59 self.arch = 'ia32' | |
| 60 else: | |
| 61 self.arch=arch | |
|
kustermann
2013/08/19 13:25:32
space around '='
ricow1
2013/08/20 10:25:50
Done.
| |
| 56 | 62 |
| 57 def PrintBuildInfo(self): | 63 def PrintBuildInfo(self): |
| 58 shard_description = "" | 64 shard_description = "" |
| 59 if self.shard_index: | 65 if self.shard_index: |
| 60 shard_description = " shard %s of %s" % (self.shard_index, | 66 shard_description = " shard %s of %s" % (self.shard_index, |
| 61 self.total_shards) | 67 self.total_shards) |
| 62 print ("compiler: %s, runtime: %s mode: %s, system: %s," | 68 print ("compiler: %s, runtime: %s mode: %s, system: %s," |
| 63 " checked: %s, host-checked: %s, minified: %s, test-set: %s%s" | 69 " checked: %s, host-checked: %s, minified: %s, test-set: %s" |
| 70 " arch: %s%s" | |
| 64 ) % (self.compiler, self.runtime, self.mode, self.system, | 71 ) % (self.compiler, self.runtime, self.mode, self.system, |
| 65 self.checked, self.host_checked, self.minified, self.test_set, | 72 self.checked, self.host_checked, self.minified, self.test_set, |
| 66 shard_description) | 73 self.arch, shard_description) |
| 67 | 74 |
| 68 | 75 |
| 69 class BuildStep(object): | 76 class BuildStep(object): |
| 70 """ | 77 """ |
| 71 A context manager for handling build steps. | 78 A context manager for handling build steps. |
| 72 | 79 |
| 73 When the context manager is entered, it prints the "@@@BUILD_STEP __@@@" | 80 When the context manager is entered, it prints the "@@@BUILD_STEP __@@@" |
| 74 message. If it exits from an error being raised it displays the | 81 message. If it exits from an error being raised it displays the |
| 75 "@@@STEP_FAILURE@@@" message. | 82 "@@@STEP_FAILURE@@@" message. |
| 76 | 83 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 95 | 102 |
| 96 def BuildSDK(build_info): | 103 def BuildSDK(build_info): |
| 97 """ | 104 """ |
| 98 Builds the SDK. | 105 Builds the SDK. |
| 99 | 106 |
| 100 - build_info: the buildInfo object, containing information about what sort of | 107 - build_info: the buildInfo object, containing information about what sort of |
| 101 build and test to be run. | 108 build and test to be run. |
| 102 """ | 109 """ |
| 103 with BuildStep('Build SDK'): | 110 with BuildStep('Build SDK'): |
| 104 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, | 111 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, |
| 105 'create_sdk'] | 112 '--arch=' + build_info.arch, 'create_sdk'] |
| 106 print 'Building SDK: %s' % (' '.join(args)) | 113 print 'Building SDK: %s' % (' '.join(args)) |
| 107 RunProcess(args) | 114 RunProcess(args) |
| 108 | 115 |
| 109 | 116 |
| 110 def RunBot(parse_name, custom_steps, build_step=BuildSDK): | 117 def RunBot(parse_name, custom_steps, build_step=BuildSDK): |
| 111 """ | 118 """ |
| 112 The main function for running a buildbot. | 119 The main function for running a buildbot. |
| 113 | 120 |
| 114 A buildbot script should invoke this once. The parse_name function will be | 121 A buildbot script should invoke this once. The parse_name function will be |
| 115 called with the name of the buildbot and should return an instance of | 122 called with the name of the buildbot and should return an instance of |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 step_name = GetStepName(name, flags) | 205 step_name = GetStepName(name, flags) |
| 199 with BuildStep(step_name): | 206 with BuildStep(step_name): |
| 200 sys.stdout.flush() | 207 sys.stdout.flush() |
| 201 | 208 |
| 202 cmd = [ | 209 cmd = [ |
| 203 sys.executable, os.path.join(os.curdir, 'tools', 'test.py'), | 210 sys.executable, os.path.join(os.curdir, 'tools', 'test.py'), |
| 204 '--step_name=' + step_name, | 211 '--step_name=' + step_name, |
| 205 '--mode=' + build_info.mode, | 212 '--mode=' + build_info.mode, |
| 206 '--compiler=' + build_info.compiler, | 213 '--compiler=' + build_info.compiler, |
| 207 '--runtime=' + build_info.runtime, | 214 '--runtime=' + build_info.runtime, |
| 215 '--arch=' + build_info.arch, | |
| 208 '--progress=buildbot', | 216 '--progress=buildbot', |
| 209 '-v', '--time', '--use-sdk', '--report' | 217 '-v', '--time', '--use-sdk', '--report' |
| 210 ] | 218 ] |
| 211 | 219 |
| 212 if build_info.checked: | 220 if build_info.checked: |
| 213 cmd.append('--checked') | 221 cmd.append('--checked') |
| 214 | 222 |
| 215 cmd.extend(flags) | 223 cmd.extend(flags) |
| 216 cmd.extend(targets) | 224 cmd.extend(targets) |
| 217 | 225 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 233 if exit_code != 0: | 241 if exit_code != 0: |
| 234 raise OSError(exit_code) | 242 raise OSError(exit_code) |
| 235 | 243 |
| 236 | 244 |
| 237 def GetStepName(name, flags): | 245 def GetStepName(name, flags): |
| 238 """ | 246 """ |
| 239 Filters out flags with '=' as this breaks the /stats feature of the buildbot. | 247 Filters out flags with '=' as this breaks the /stats feature of the buildbot. |
| 240 """ | 248 """ |
| 241 flags = [x for x in flags if not '=' in x] | 249 flags = [x for x in flags if not '=' in x] |
| 242 return ('%s tests %s' % (name, ' '.join(flags))).strip() | 250 return ('%s tests %s' % (name, ' '.join(flags))).strip() |
| OLD | NEW |