Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import contextlib | 5 import contextlib |
| 6 import imp | 6 import imp |
| 7 import inspect | 7 import inspect |
| 8 import logging | 8 import logging |
| 9 import multiprocessing | 9 import multiprocessing |
| 10 import os | 10 import os |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 if opts.handler.stdin: | 322 if opts.handler.stdin: |
| 323 sys.stdin = opts.handler.stdin | 323 sys.stdin = opts.handler.stdin |
| 324 | 324 |
| 325 SKIP = object() | 325 SKIP = object() |
| 326 def process_test(run_ctx, subtest): | 326 def process_test(run_ctx, subtest): |
| 327 """run_ctx: context manager | 327 """run_ctx: context manager |
| 328 subtest: Test or subclass of | 328 subtest: Test or subclass of |
| 329 """ | 329 """ |
| 330 logstream.reset() | 330 logstream.reset() |
| 331 try: | 331 try: |
| 332 with run_ctx(subtest): | 332 with cover_ctx.update(include=subtest.coverage_includes()): |
| 333 with cover_ctx.update(include=subtest.coverage_includes()): | 333 with use_chdir(cwd): |
|
dnj
2014/12/02 20:47:26
Is the reason for this that the 'chdir' is necessa
pgervais
2014/12/02 21:17:00
TBH, I don't know. There's only an issue with the
pgervais
2014/12/02 21:32:06
Yep, it works with use_chdir at the lowest level.
| |
| 334 with use_chdir(cwd): | 334 with run_ctx(subtest): |
| 335 subresult = subtest.run() | 335 subresult = subtest.run() |
| 336 | 336 |
| 337 except Exception: | 337 except Exception: |
| 338 result_queue.put_nowait( | 338 result_queue.put_nowait( |
| 339 TestError(subtest, traceback.format_exc(), | 339 TestError(subtest, traceback.format_exc(), |
| 340 logstream.getvalue().splitlines())) | 340 logstream.getvalue().splitlines())) |
| 341 return SKIP | 341 return SKIP |
| 342 if isinstance(subresult, TestError): | 342 if isinstance(subresult, TestError): |
| 343 result_queue.put_nowait(subresult) | 343 result_queue.put_nowait(subresult) |
| 344 return SKIP | 344 return SKIP |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 522 | 522 |
| 523 if procs: | 523 if procs: |
| 524 error = opts.handler.result_stage_loop(opts, generate_objects(procs)) | 524 error = opts.handler.result_stage_loop(opts, generate_objects(procs)) |
| 525 except ResultStageAbort: | 525 except ResultStageAbort: |
| 526 pass | 526 pass |
| 527 | 527 |
| 528 if not kill_switch.is_set() and not result_queue.empty(): | 528 if not kill_switch.is_set() and not result_queue.empty(): |
| 529 error = True | 529 error = True |
| 530 | 530 |
| 531 return error, kill_switch.is_set() | 531 return error, kill_switch.is_set() |
| OLD | NEW |