| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 def RunTestRunner(build_info, path): | 248 def RunTestRunner(build_info, path): |
| 249 """ | 249 """ |
| 250 Runs the test package's runner on the package at 'path'. | 250 Runs the test package's runner on the package at 'path'. |
| 251 """ | 251 """ |
| 252 sdk_bin = os.path.join( | 252 sdk_bin = os.path.join( |
| 253 bot_utils.DART_DIR, | 253 bot_utils.DART_DIR, |
| 254 utils.GetBuildSdkBin(BUILD_OS, build_info.mode, build_info.arch)) | 254 utils.GetBuildSdkBin(BUILD_OS, build_info.mode, build_info.arch)) |
| 255 | 255 |
| 256 build_root = utils.GetBuildRoot( | 256 build_root = utils.GetBuildRoot( |
| 257 BUILD_OS, build_info.mode, build_info.arch) | 257 BUILD_OS, build_info.mode, build_info.arch) |
| 258 package_root = os.path.abspath(os.path.join(build_root, 'packages')) | |
| 259 | 258 |
| 260 dart_name = 'dart.exe' if build_info.system == 'windows' else 'dart' | 259 dart_name = 'dart.exe' if build_info.system == 'windows' else 'dart' |
| 261 dart_bin = os.path.join(sdk_bin, dart_name) | 260 dart_bin = os.path.join(sdk_bin, dart_name) |
| 262 | 261 |
| 263 test_bin = os.path.abspath( | 262 test_bin = os.path.abspath( |
| 264 os.path.join('third_party', 'pkg', 'test', 'bin', 'test.dart')) | 263 os.path.join('third_party', 'pkg', 'test', 'bin', 'test.dart')) |
| 265 | 264 |
| 266 with utils.ChangedWorkingDirectory(path): | 265 with utils.ChangedWorkingDirectory(path): |
| 267 args = [dart_bin, '--package-root=' + package_root, test_bin, | 266 args = [dart_bin, test_bin, '--reporter', 'expanded', '--no-color'] |
| 268 '--package-root', package_root, '--reporter', 'expanded', | |
| 269 '--no-color'] | |
| 270 print("Running %s" % ' '.join(args)) | 267 print("Running %s" % ' '.join(args)) |
| 271 RunProcess(args) | 268 RunProcess(args) |
| 272 | 269 |
| 273 | 270 |
| 274 def RunProcess(command, env=None): | 271 def RunProcess(command, env=None): |
| 275 """ | 272 """ |
| 276 Runs command. | 273 Runs command. |
| 277 | 274 |
| 278 If a non-zero exit code is returned, raises an OSError with errno as the exit | 275 If a non-zero exit code is returned, raises an OSError with errno as the exit |
| 279 code. | 276 code. |
| 280 """ | 277 """ |
| 281 if env is None: | 278 if env is None: |
| 282 no_color_env = dict(os.environ) | 279 no_color_env = dict(os.environ) |
| 283 else: | 280 else: |
| 284 no_color_env = env | 281 no_color_env = env |
| 285 no_color_env['TERM'] = 'nocolor' | 282 no_color_env['TERM'] = 'nocolor' |
| 286 | 283 |
| 287 exit_code = subprocess.call(command, env=no_color_env) | 284 exit_code = subprocess.call(command, env=no_color_env) |
| 288 if exit_code != 0: | 285 if exit_code != 0: |
| 289 raise OSError(exit_code) | 286 raise OSError(exit_code) |
| 290 | 287 |
| 291 | 288 |
| 292 def GetStepName(name, flags): | 289 def GetStepName(name, flags): |
| 293 """ | 290 """ |
| 294 Filters out flags with '=' as this breaks the /stats feature of the buildbot. | 291 Filters out flags with '=' as this breaks the /stats feature of the buildbot. |
| 295 """ | 292 """ |
| 296 flags = [x for x in flags if not '=' in x] | 293 flags = [x for x in flags if not '=' in x] |
| 297 return ('%s tests %s' % (name, ' '.join(flags))).strip() | 294 return ('%s tests %s' % (name, ' '.join(flags))).strip() |
| OLD | NEW |