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

Side by Side Diff: third_party/recipe_engine/expect_tests/handle_debug.py

Issue 1347263002: Revert of Cross-repo recipe package system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 3 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 .type_definitions import Handler
9
10
11 class DebugHandler(Handler):
12 """Execute each test under the pdb debugger."""
13 SKIP_RUNLOOP = True
14
15 class ResultStageHandler(Handler.ResultStageHandler):
16 @staticmethod
17 def handle_MultiTest(mtest):
18 for _ in mtest.process(DebugHandler.ResultStageHandler.handle_Test):
19 pass
20
21 @staticmethod
22 def handle_Test(test):
23 dbg = pdb.Pdb()
24 for path, line, funcname in test.breakpoints:
25 dbg.set_break(path, line, funcname=funcname)
26
27 dbg.reset()
28
29 def dispatch_thunk(*args):
30 """Allows us to continue until the actual breakpoint."""
31 val = dbg.trace_dispatch(*args)
32 dbg.set_continue()
33 sys.settrace(dbg.trace_dispatch)
34 return val
35 sys.settrace(dispatch_thunk)
36 try:
37 test.run()
38 except pdb.bdb.BdbQuit:
39 pass
40 finally:
41 dbg.quitting = 1
42 sys.settrace(None)
OLDNEW
« no previous file with comments | « third_party/recipe_engine/expect_tests/cover.py ('k') | third_party/recipe_engine/expect_tests/handle_list.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698