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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 print 'Could not handle unfamiliar bot name "%s".' % name | 130 print 'Could not handle unfamiliar bot name "%s".' % name |
131 sys.exit(1) | 131 sys.exit(1) |
132 | 132 |
133 # Print out the buildinfo for easy debugging. | 133 # Print out the buildinfo for easy debugging. |
134 build_info.PrintBuildInfo() | 134 build_info.PrintBuildInfo() |
135 | 135 |
136 # Make sure we are in the dart directory | 136 # Make sure we are in the dart directory |
137 os.chdir(DART_PATH) | 137 os.chdir(DART_PATH) |
138 | 138 |
139 try: | 139 try: |
140 Clobber(build_info.mode) | 140 Clobber() |
141 build_step(build_info) | 141 build_step(build_info) |
142 | 142 |
143 custom_steps(build_info) | 143 custom_steps(build_info) |
144 except OSError as e: | 144 except OSError as e: |
145 sys.exit(e.errno) | 145 sys.exit(e.errno) |
146 | 146 |
147 sys.exit(0) | 147 sys.exit(0) |
148 | 148 |
149 | 149 |
150 def GetBotName(): | 150 def GetBotName(): |
(...skipping 13 matching lines...) Expand all Loading... |
164 return args.name, False | 164 return args.name, False |
165 | 165 |
166 name = os.environ.get(BUILDER_NAME) | 166 name = os.environ.get(BUILDER_NAME) |
167 if not name: | 167 if not name: |
168 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.' | 168 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.' |
169 sys.exit(1) | 169 sys.exit(1) |
170 | 170 |
171 return name, True | 171 return name, True |
172 | 172 |
173 | 173 |
174 def Clobber(mode): | 174 def Clobber(): |
175 """ | 175 """ |
176 Clobbers the builder before we do the build, if appropriate. | 176 Clobbers the builder before we do the build, if appropriate. |
177 | 177 |
178 - mode: either 'debug' or 'release' | 178 - mode: either 'debug' or 'release' |
179 """ | 179 """ |
180 if os.environ.get(BUILDER_CLOBBER) != "1": | 180 if os.environ.get(BUILDER_CLOBBER) != "1": |
181 return | 181 return |
182 | 182 |
183 with BuildStep('Clobber'): | 183 with BuildStep('Clobber'): |
184 cmd = [sys.executable, | 184 cmd = [sys.executable, |
185 './tools/clean_output_directory.py', | 185 './tools/clean_output_directory.py'] |
186 '--mode=' + mode] | |
187 print 'Clobbering %s' % (' '.join(cmd)) | 186 print 'Clobbering %s' % (' '.join(cmd)) |
188 RunProcess(cmd) | 187 RunProcess(cmd) |
189 | 188 |
190 | 189 |
191 def RunTest(name, build_info, targets, flags=None): | 190 def RunTest(name, build_info, targets, flags=None): |
192 """ | 191 """ |
193 Runs test.py with the given settings. | 192 Runs test.py with the given settings. |
194 """ | 193 """ |
195 if not flags: | 194 if not flags: |
196 flags = [] | 195 flags = [] |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 if exit_code != 0: | 229 if exit_code != 0: |
231 raise OSError(exit_code) | 230 raise OSError(exit_code) |
232 | 231 |
233 | 232 |
234 def GetStepName(name, flags): | 233 def GetStepName(name, flags): |
235 """ | 234 """ |
236 Filters out flags with '=' as this breaks the /stats feature of the buildbot. | 235 Filters out flags with '=' as this breaks the /stats feature of the buildbot. |
237 """ | 236 """ |
238 flags = [x for x in flags if not '=' in x] | 237 flags = [x for x in flags if not '=' in x] |
239 return ('%s tests %s' % (name, ' '.join(flags))).strip() | 238 return ('%s tests %s' % (name, ' '.join(flags))).strip() |
OLD | NEW |