| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return args.name, False | 178 return args.name, False |
| 179 | 179 |
| 180 name = os.environ.get(BUILDER_NAME) | 180 name = os.environ.get(BUILDER_NAME) |
| 181 if not name: | 181 if not name: |
| 182 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.' | 182 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.' |
| 183 sys.exit(1) | 183 sys.exit(1) |
| 184 | 184 |
| 185 return name, True | 185 return name, True |
| 186 | 186 |
| 187 | 187 |
| 188 def Clobber(): | 188 def Clobber(force=None): |
| 189 """ | 189 """ |
| 190 Clobbers the builder before we do the build, if appropriate. | 190 Clobbers the builder before we do the build, if appropriate. |
| 191 | 191 |
| 192 - mode: either 'debug' or 'release' | 192 - mode: either 'debug' or 'release' |
| 193 """ | 193 """ |
| 194 if os.environ.get(BUILDER_CLOBBER) != "1": | 194 if os.environ.get(BUILDER_CLOBBER) != "1" and not force: |
| 195 return | 195 return |
| 196 clobber_string = 'Clobber' |
| 197 if force: |
| 198 clobber_string = 'Clobber(always)' |
| 196 | 199 |
| 197 with BuildStep('Clobber'): | 200 with BuildStep(clobber_string): |
| 198 cmd = [sys.executable, | 201 cmd = [sys.executable, |
| 199 './tools/clean_output_directory.py'] | 202 './tools/clean_output_directory.py'] |
| 200 print 'Clobbering %s' % (' '.join(cmd)) | 203 print 'Clobbering %s' % (' '.join(cmd)) |
| 201 RunProcess(cmd) | 204 RunProcess(cmd) |
| 202 | 205 |
| 203 | 206 |
| 204 def RunTest(name, build_info, targets, flags=None): | 207 def RunTest(name, build_info, targets, flags=None): |
| 205 """ | 208 """ |
| 206 Runs test.py with the given settings. | 209 Runs test.py with the given settings. |
| 207 """ | 210 """ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 if exit_code != 0: | 250 if exit_code != 0: |
| 248 raise OSError(exit_code) | 251 raise OSError(exit_code) |
| 249 | 252 |
| 250 | 253 |
| 251 def GetStepName(name, flags): | 254 def GetStepName(name, flags): |
| 252 """ | 255 """ |
| 253 Filters out flags with '=' as this breaks the /stats feature of the buildbot. | 256 Filters out flags with '=' as this breaks the /stats feature of the buildbot. |
| 254 """ | 257 """ |
| 255 flags = [x for x in flags if not '=' in x] | 258 flags = [x for x in flags if not '=' in x] |
| 256 return ('%s tests %s' % (name, ' '.join(flags))).strip() | 259 return ('%s tests %s' % (name, ' '.join(flags))).strip() |
| OLD | NEW |