Bug 592527 - runtest.py and runxpcshelltest.py should ignore ctrl-c when using an interactive debugger. r=ted, a=only-sorta-potb
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 31 Aug 2010 18:03:38 -0700
changeset 52193 26807152d00d02faa7f22bbdc6dcc4be0e6a7f1c
parent 52192 968712243f34c69d83f05ac92b5aabe5cf9cc696
child 52194 a654e877432a99dd55e4c2dcda0e0c717bae6ac6
push id15567
push userjlebar@mozilla.com
push dateWed, 08 Sep 2010 17:33:03 +0000
treeherdermozilla-central@26807152d00d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, only-sorta-potb
bugs592527
milestone2.0b6pre
first release with
nightly win64
26807152d00d / 4.0b6pre / 20100908113106 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 592527 - runtest.py and runxpcshelltest.py should ignore ctrl-c when using an interactive debugger. r=ted, a=only-sorta-potb
build/automation.py.in
testing/xpcshell/runxpcshelltests.py
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -855,21 +855,22 @@ user_pref("camino.use_system_proxy_setti
                                os.path.join(profileDir, "ssltunnel.cfg")], 
                                env = self.environment(xrePath = xrePath))
       self.log.info("INFO | automation.py | SSL tunnel pid: %d", ssltunnelProcess.pid)
 
     cmd, args = self.buildCommandLine(app, debuggerInfo, profileDir, testURL, extraArgs)
     startTime = datetime.now()
 
     if debuggerInfo and debuggerInfo["interactive"]:
-      # If an interactive debugger is attached, don't redirect output
-      # and don't use timeouts.
+      # If an interactive debugger is attached, don't redirect output,
+      # don't use timeouts, and don't capture ctrl-c.
       timeout = None
       maxTime = None
       outputPipe = None
+      signal.signal(signal.SIGINT, lambda sigid, frame: None)
     else:
       outputPipe = subprocess.PIPE
 
     self.lastTestSeen = "automation.py"
     proc = self.Process([cmd] + args,
                  env = self.environment(env, xrePath = xrePath,
                                    crashreporter = not debuggerInfo),
                  stdout = outputPipe,
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -418,16 +418,20 @@ class XPCShellTests(object):
     self.interactive = interactive
     self.verbose = verbose
     self.logfiles = logfiles
     self.totalChunks = totalChunks
     self.thisChunk = thisChunk
     self.debuggerInfo = getDebuggerInfo(self.oldcwd, debugger, debuggerArgs, debuggerInteractive)
     self.profileName = profileName or "xpcshell"
 
+    # If we have an interactive debugger, disable ctrl-c.
+    if self.debuggerInfo and self.debuggerInfo["interactive"]:
+        signal.signal(signal.SIGINT, lambda signum, frame: None)
+
     if not testdirs and not manifest:
       # nothing to test!
       print >>sys.stderr, "Error: No test dirs or test manifest specified!"
       return False
 
     passCount = 0
     failCount = 0