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

Unified 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: fix coverage race Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/slave/unittests/expect_tests/cover.py ('k') | scripts/slave/unittests/expect_tests/handle_list.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/expect_tests/handle_debug.py
diff --git a/scripts/slave/unittests/expect_tests/handle_debug.py b/scripts/slave/unittests/expect_tests/handle_debug.py
new file mode 100644
index 0000000000000000000000000000000000000000..70cddb5f253703f5386a5efbdeb8c2e8345a77f3
--- /dev/null
+++ b/scripts/slave/unittests/expect_tests/handle_debug.py
@@ -0,0 +1,37 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys
+import pdb
+
+from .type_definitions import Handler
+
+
+class DebugHandler(Handler):
+ """Execute each test under the pdb debugger."""
+ SKIP_RUNLOOP = True
+
+ class ResultStageHandler(Handler.ResultStageHandler):
+ @staticmethod
+ def handle_Test(test):
+ dbg = pdb.Pdb()
+ for path, line, funcname in test.breakpoints:
+ dbg.set_break(path, line, funcname=funcname)
+
+ dbg.reset()
+
+ def dispatch_thunk(*args):
+ """Allows us to continue until the actual breakpoint."""
+ val = dbg.trace_dispatch(*args)
+ dbg.set_continue()
+ sys.settrace(dbg.trace_dispatch)
+ return val
+ sys.settrace(dispatch_thunk)
+ try:
+ test.run()
+ except pdb.bdb.BdbQuit:
+ pass
+ finally:
+ dbg.quitting = 1
+ sys.settrace(None)
« no previous file with comments | « scripts/slave/unittests/expect_tests/cover.py ('k') | scripts/slave/unittests/expect_tests/handle_list.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698