Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: scripts/slave/unittests/expect_tests/handle_debug.py

Issue 220353003: Replace recipes_test.py with a new parallel expectation-based test runner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: refactor Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 import sys
6 import pdb
7
8 from .types import Handler
9
10 class DebugHandler(Handler):
11 """Execute each test under the pdb debugger."""
12 SKIP_RUNLOOP = True
13
14 class ResultStageHandler(Handler.ResultStageHandler):
15 @staticmethod
16 def Test(test):
17 dbg = pdb.Pdb()
18 for path, line, funcname in test.breakpoints:
19 dbg.set_break(path, line, funcname=funcname)
20
21 dbg.reset()
22
23 def dispatch_thunk(*args):
24 """Allows us to continue until the actual breakpoint."""
25 val = dbg.trace_dispatch(*args)
26 dbg.set_continue()
27 sys.settrace(dbg.trace_dispatch)
28 return val
29 sys.settrace(dispatch_thunk)
30 try:
31 test.run()
32 except pdb.bdb.BdbQuit:
33 pass
34 finally:
35 dbg.quitting = 1
36 sys.settrace(None)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698