Bug 938706 - (1) Fix minidumps for Android xpcshell; r=ted

This commit is contained in:
Geoff Brown
2013-11-21 10:22:16 -07:00
parent 5e867753f7
commit ea3100d1cf
2 changed files with 23 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ from automationutils import replaceBackSlashes
from mozdevice import devicemanagerADB, devicemanagerSUT, devicemanager from mozdevice import devicemanagerADB, devicemanagerSUT, devicemanager
from zipfile import ZipFile from zipfile import ZipFile
import shutil import shutil
import mozfile
import mozinfo import mozinfo
here = os.path.dirname(os.path.abspath(__file__)) here = os.path.dirname(os.path.abspath(__file__))
@@ -133,6 +134,17 @@ class RemoteXPCShellTestThread(xpcshell.XPCShellTestThread):
self.device.killProcess("xpcshell") self.device.killProcess("xpcshell")
return outputFile return outputFile
def checkForCrashes(self,
dump_directory,
symbols_path,
test_name=None):
with mozfile.TemporaryDirectory() as dumpDir:
self.device.getDirectory(self.remoteTmpDir, dumpDir)
crashed = xpcshell.XPCShellTestThread.checkForCrashes(self, dumpDir, symbols_path, test_name)
self.device.removeDir(self.remoteTmpDir)
self.device.mkDir(self.remoteTmpDir)
return crashed
def communicate(self, proc): def communicate(self, proc):
f = open(proc, "r") f = open(proc, "r")
contents = f.read() contents = f.read()

View File

@@ -224,6 +224,16 @@ class XPCShellTestThread(Thread):
env=env, cwd=cwd) env=env, cwd=cwd)
return proc return proc
def checkForCrashes(self,
dump_directory,
symbols_path,
test_name=None):
"""
Simple wrapper to check for crashes.
On a remote system, this is more complex and we need to overload this function.
"""
return mozcrash.check_for_crashes(dump_directory, symbols_path, test_name=test_name)
def logCommand(self, name, completeCmd, testdir): def logCommand(self, name, completeCmd, testdir):
self.log.info("TEST-INFO | %s | full command: %r" % (name, completeCmd)) self.log.info("TEST-INFO | %s | full command: %r" % (name, completeCmd))
self.log.info("TEST-INFO | %s | current directory: %r" % (name, testdir)) self.log.info("TEST-INFO | %s | current directory: %r" % (name, testdir))
@@ -658,7 +668,7 @@ class XPCShellTestThread(Thread):
self.todoCount = 1 self.todoCount = 1
self.xunit_result["todo"] = True self.xunit_result["todo"] = True
if mozcrash.check_for_crashes(self.tempDir, self.symbolsPath, test_name=name): if self.checkForCrashes(self.tempDir, self.symbolsPath, test_name=name):
if self.retry: if self.retry:
self.clean_temp_dirs(name, stdout) self.clean_temp_dirs(name, stdout)
return return