Bug 818638 - B2G xpcshell shouldn't abort entire test run on single test timeout, r=jgriffin, DONTBUILD a=NPOTB,test-only
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 07 Dec 2012 11:37:16 -0500
changeset 115695 83d589dc84c1d831c104368d78f382faef1c79c9
parent 115679 8432562db685e244ab6431a8bc307d8a32183451
child 115696 e83769592c610fdae7744bd4cea92b386c90de82
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersjgriffin, DONTBUILD, NPOTB, test-only
bugs818638
milestone20.0a1
Bug 818638 - B2G xpcshell shouldn't abort entire test run on single test timeout, r=jgriffin, DONTBUILD a=NPOTB,test-only
testing/xpcshell/runtestsb2g.py
--- a/testing/xpcshell/runtestsb2g.py
+++ b/testing/xpcshell/runtestsb2g.py
@@ -60,24 +60,28 @@ class B2GXPCShellRemote(XPCShellRemote):
     def setLD_LIBRARY_PATH(self, env):
         if self.options.use_device_libs:
             env['LD_LIBRARY_PATH'] = '/system/b2g'
             env['LD_PRELOAD'] = '/system/b2g/libmozglue.so'
         else:
             XPCShellRemote.setLD_LIBRARY_PATH(self, env)
 
     # Overridden
-    # This returns 1 even when tests pass - this is why it's switched to 0
-    # https://bugzilla.mozilla.org/show_bug.cgi?id=773703
-    def getReturnCode(self, proc):
-#        if self.shellReturnCode is not None:
-#            return self.shellReturnCode
-#        return -1
-        return 0
-
+    def launchProcess(self, cmd, stdout, stderr, env, cwd):
+        try:
+            # This returns 1 even when tests pass - hardcode returncode to 0 (bug 773703)
+            outputFile = XPCShellRemote.launchProcess(self, cmd, stdout, stderr, env, cwd)
+            self.shellReturnCode = 0
+        except DMError:
+            self.shellReturnCode = -1
+            outputFile = "xpcshelloutput"
+            f = open(outputFile, "a")
+            f.write("\n%s" % traceback.format_exc())
+            f.close()
+        return outputFile
 
 class B2GOptions(RemoteXPCShellOptions):
 
     def __init__(self):
         RemoteXPCShellOptions.__init__(self)
         defaults = {}
 
         self.add_option('--b2gpath', action='store',