| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 sys.exit(1) | 144 sys.exit(1) |
| 145 | 145 |
| 146 # Print out the buildinfo for easy debugging. | 146 # Print out the buildinfo for easy debugging. |
| 147 build_info.PrintBuildInfo() | 147 build_info.PrintBuildInfo() |
| 148 | 148 |
| 149 # Make sure we are in the dart directory | 149 # Make sure we are in the dart directory |
| 150 os.chdir(DART_PATH) | 150 os.chdir(DART_PATH) |
| 151 | 151 |
| 152 try: | 152 try: |
| 153 Clobber() | 153 Clobber() |
| 154 if build_step: | 154 if build_step: |
| 155 build_step(build_info) | 155 build_step(build_info) |
| 156 | 156 |
| 157 custom_steps(build_info) | 157 custom_steps(build_info) |
| 158 except OSError as e: | 158 except OSError as e: |
| 159 sys.exit(e.errno) | 159 sys.exit(e.errno) |
| 160 | 160 |
| 161 sys.exit(0) | 161 sys.exit(0) |
| 162 | 162 |
| 163 | 163 |
| 164 def GetBotName(): | 164 def GetBotName(): |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 if force: | 197 if force: |
| 198 clobber_string = 'Clobber(always)' | 198 clobber_string = 'Clobber(always)' |
| 199 | 199 |
| 200 with BuildStep(clobber_string): | 200 with BuildStep(clobber_string): |
| 201 cmd = [sys.executable, | 201 cmd = [sys.executable, |
| 202 './tools/clean_output_directory.py'] | 202 './tools/clean_output_directory.py'] |
| 203 print 'Clobbering %s' % (' '.join(cmd)) | 203 print 'Clobbering %s' % (' '.join(cmd)) |
| 204 RunProcess(cmd) | 204 RunProcess(cmd) |
| 205 | 205 |
| 206 | 206 |
| 207 def RunTest(name, build_info, targets, flags=None): | 207 def RunTest(name, build_info, targets, flags=None, swallow_error=False): |
| 208 """ | 208 """ |
| 209 Runs test.py with the given settings. | 209 Runs test.py with the given settings. |
| 210 """ | 210 """ |
| 211 if not flags: | 211 if not flags: |
| 212 flags = [] | 212 flags = [] |
| 213 | 213 |
| 214 step_name = GetStepName(name, flags) | 214 step_name = GetStepName(name, flags) |
| 215 with BuildStep(step_name): | 215 with BuildStep(step_name, swallow_error=swallow_error): |
| 216 sys.stdout.flush() | 216 sys.stdout.flush() |
| 217 | 217 |
| 218 cmd = [ | 218 cmd = [ |
| 219 sys.executable, os.path.join(os.curdir, 'tools', 'test.py'), | 219 sys.executable, os.path.join(os.curdir, 'tools', 'test.py'), |
| 220 '--step_name=' + step_name, | 220 '--step_name=' + step_name, |
| 221 '--mode=' + build_info.mode, | 221 '--mode=' + build_info.mode, |
| 222 '--compiler=' + build_info.compiler, | 222 '--compiler=' + build_info.compiler, |
| 223 '--runtime=' + build_info.runtime, | 223 '--runtime=' + build_info.runtime, |
| 224 '--arch=' + build_info.arch, | 224 '--arch=' + build_info.arch, |
| 225 '--progress=buildbot', | 225 '--progress=buildbot', |
| (...skipping 24 matching lines...) Expand all Loading... |
| 250 if exit_code != 0: | 250 if exit_code != 0: |
| 251 raise OSError(exit_code) | 251 raise OSError(exit_code) |
| 252 | 252 |
| 253 | 253 |
| 254 def GetStepName(name, flags): | 254 def GetStepName(name, flags): |
| 255 """ | 255 """ |
| 256 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. |
| 257 """ | 257 """ |
| 258 flags = [x for x in flags if not '=' in x] | 258 flags = [x for x in flags if not '=' in x] |
| 259 return ('%s tests %s' % (name, ' '.join(flags))).strip() | 259 return ('%s tests %s' % (name, ' '.join(flags))).strip() |
| OLD | NEW |