mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-02 12:07:52 +00:00
Bug 940637 - part 1 - add dump options to runtests.py and propagate to mochitests; r=jmaher
This commit is contained in:
parent
8fdefc9de9
commit
1fc80bff31
@ -357,6 +357,26 @@ class MochitestOptions(optparse.OptionParser):
|
||||
"dest": "dmdPath",
|
||||
"help": "Specifies the path to the directory containing the shared library for DMD.",
|
||||
}],
|
||||
[["--dump-output-directory"],
|
||||
{ "action": "store",
|
||||
"default": None,
|
||||
"dest": "dumpOutputDirectory",
|
||||
"help": "Specifies the directory in which to place dumped memory reports.",
|
||||
}],
|
||||
[["--dump-about-memory-after-test"],
|
||||
{ "action": "store_true",
|
||||
"default": False,
|
||||
"dest": "dumpAboutMemoryAfterTest",
|
||||
"help": "Produce an about:memory dump after each test in the directory specified "
|
||||
"by --dump-output-directory."
|
||||
}],
|
||||
[["--dump-dmd-after-test"],
|
||||
{ "action": "store_true",
|
||||
"default": False,
|
||||
"dest": "dumpDMDAfterTest",
|
||||
"help": "Produce a DMD dump after each test in the directory specified "
|
||||
"by --dump-output-directory."
|
||||
}],
|
||||
]
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
@ -505,6 +525,14 @@ class MochitestOptions(optparse.OptionParser):
|
||||
if not options.repeat:
|
||||
options.repeat = 29
|
||||
|
||||
if options.dumpOutputDirectory is None:
|
||||
options.dumpOutputDirectory = tempfile.gettempdir()
|
||||
|
||||
if options.dumpAboutMemoryAfterTest or options.dumpDMDAfterTest:
|
||||
if not os.path.isdir(options.dumpOutputDirectory):
|
||||
self.error('--dump-output-directory not a directory: %s' %
|
||||
options.dumpOutputDirectory)
|
||||
|
||||
return options
|
||||
|
||||
|
||||
|
@ -344,6 +344,12 @@ class MochitestUtilsMixin(object):
|
||||
self.urlOpts.append("runSlower=true")
|
||||
if options.debugOnFailure:
|
||||
self.urlOpts.append("debugOnFailure=true")
|
||||
if options.dumpOutputDirectory:
|
||||
self.urlOpts.append("dumpOutputDirectory=%s" % encodeURIComponent(options.dumpOutputDirectory))
|
||||
if options.dumpAboutMemoryAfterTest:
|
||||
self.urlOpts.append("dumpAboutMemoryAfterTest=true")
|
||||
if options.dumpDMDAfterTest:
|
||||
self.urlOpts.append("dumpDMDAfterTest=true")
|
||||
|
||||
def buildTestPath(self, options):
|
||||
""" Build the url path to the specific test harness and test file or directory
|
||||
|
@ -212,6 +212,9 @@ class RemoteOptions(MochitestOptions):
|
||||
tempPort = options.httpPort
|
||||
tempSSL = options.sslPort
|
||||
tempIP = options.webServer
|
||||
# We are going to override this option later anyway, just pretend
|
||||
# like it's not set for verification purposes.
|
||||
options.dumpOutputDirectory = None
|
||||
options = MochitestOptions.verifyOptions(self, options, mochitest)
|
||||
options.webServer = tempIP
|
||||
options.app = temp
|
||||
@ -588,6 +591,8 @@ def main():
|
||||
dm.pushFile(os.path.join(options.dmdPath, dmdLibrary), dmdPathOnDevice)
|
||||
options.dmdPath = deviceRoot
|
||||
|
||||
options.dumpOutputDirectory = deviceRoot
|
||||
|
||||
procName = options.app.split('/')[-1]
|
||||
if (dm.processExist(procName)):
|
||||
dm.killProcess(procName)
|
||||
|
Loading…
x
Reference in New Issue
Block a user