| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 If swallow_error is True, then this will catch and discard any OSError that | 80 If swallow_error is True, then this will catch and discard any OSError that |
| 81 is thrown. This lets you run later BuildSteps if the current one fails. | 81 is thrown. This lets you run later BuildSteps if the current one fails. |
| 82 """ | 82 """ |
| 83 def __init__(self, name, swallow_error=False): | 83 def __init__(self, name, swallow_error=False): |
| 84 self.name = name | 84 self.name = name |
| 85 self.swallow_error = swallow_error | 85 self.swallow_error = swallow_error |
| 86 | 86 |
| 87 def __enter__(self): | 87 def __enter__(self): |
| 88 print '@@@BUILD_STEP %s@@@' % self.name | 88 print '@@@BUILD_STEP %s@@@' % self.name |
| 89 sys.stdout.flush() |
| 89 | 90 |
| 90 def __exit__(self, type, value, traceback): | 91 def __exit__(self, type, value, traceback): |
| 91 if value: | 92 if value: |
| 92 print '@@@STEP_FAILURE@@@' | 93 print '@@@STEP_FAILURE@@@' |
| 94 sys.stdout.flush() |
| 93 if self.swallow_error and isinstance(value, OSError): | 95 if self.swallow_error and isinstance(value, OSError): |
| 94 return True | 96 return True |
| 95 | 97 |
| 96 | 98 |
| 97 def BuildSDK(build_info): | 99 def BuildSDK(build_info): |
| 98 """ | 100 """ |
| 99 Builds the SDK. | 101 Builds the SDK. |
| 100 | 102 |
| 101 - build_info: the buildInfo object, containing information about what sort of | 103 - build_info: the buildInfo object, containing information about what sort of |
| 102 build and test to be run. | 104 build and test to be run. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 if exit_code != 0: | 233 if exit_code != 0: |
| 232 raise OSError(exit_code) | 234 raise OSError(exit_code) |
| 233 | 235 |
| 234 | 236 |
| 235 def GetStepName(name, flags): | 237 def GetStepName(name, flags): |
| 236 """ | 238 """ |
| 237 Filters out flags with '=' as this breaks the /stats feature of the buildbot. | 239 Filters out flags with '=' as this breaks the /stats feature of the buildbot. |
| 238 """ | 240 """ |
| 239 flags = [x for x in flags if not '=' in x] | 241 flags = [x for x in flags if not '=' in x] |
| 240 return ('%s tests %s' % (name, ' '.join(flags))).strip() | 242 return ('%s tests %s' % (name, ' '.join(flags))).strip() |
| OLD | NEW |