Bug 938706 - (1) Fix minidumps for Android xpcshell; r=ted
This commit is contained in:
@@ -13,6 +13,7 @@ from automationutils import replaceBackSlashes
|
||||
from mozdevice import devicemanagerADB, devicemanagerSUT, devicemanager
|
||||
from zipfile import ZipFile
|
||||
import shutil
|
||||
import mozfile
|
||||
import mozinfo
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
@@ -133,6 +134,17 @@ class RemoteXPCShellTestThread(xpcshell.XPCShellTestThread):
|
||||
self.device.killProcess("xpcshell")
|
||||
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):
|
||||
f = open(proc, "r")
|
||||
contents = f.read()
|
||||
|
||||
@@ -224,6 +224,16 @@ class XPCShellTestThread(Thread):
|
||||
env=env, cwd=cwd)
|
||||
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):
|
||||
self.log.info("TEST-INFO | %s | full command: %r" % (name, completeCmd))
|
||||
self.log.info("TEST-INFO | %s | current directory: %r" % (name, testdir))
|
||||
@@ -658,7 +668,7 @@ class XPCShellTestThread(Thread):
|
||||
self.todoCount = 1
|
||||
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:
|
||||
self.clean_temp_dirs(name, stdout)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user