Bug 1091280 - moved options from AutomationUtils.addCommonOptions to runreftest.py, mochitest_options.py, runxpcshelltests.py and removed the addCommonOptions from automationUtils and automation.py.in, r=ahal

This commit is contained in:
Nazma Panjwani 2014-11-19 12:31:45 -08:00
Родитель 48c4761304
Коммит 9bd7bfc683
5 изменённых файлов: 69 добавлений и 43 удалений

Просмотреть файл

@ -181,7 +181,6 @@ class Automation(object):
"log", "log",
"runApp", "runApp",
"Process", "Process",
"addCommonOptions",
"initializeProfile", "initializeProfile",
"DIST_BIN", "DIST_BIN",
"DEFAULT_APP", "DEFAULT_APP",
@ -385,15 +384,6 @@ class Automation(object):
proxy=proxy) proxy=proxy)
return profile return profile
def addCommonOptions(self, parser):
"Adds command-line options which are common to mochitest and reftest."
parser.add_option("--setpref",
action = "append", type = "string",
default = [],
dest = "extraPrefs", metavar = "PREF=VALUE",
help = "defines an extra user preference")
def fillCertificateDB(self, profileDir, certPath, utilityPath, xrePath): def fillCertificateDB(self, profileDir, certPath, utilityPath, xrePath):
pwfilePath = os.path.join(profileDir, ".crtdbpw") pwfilePath = os.path.join(profileDir, ".crtdbpw")
pwfile = open(pwfilePath, "w") pwfile = open(pwfilePath, "w")

Просмотреть файл

@ -18,7 +18,6 @@ import mozinfo
__all__ = [ __all__ = [
"ZipFileReader", "ZipFileReader",
"addCommonOptions",
"dumpLeakLog", "dumpLeakLog",
"processLeakLog", "processLeakLog",
'systemMemory', 'systemMemory',
@ -140,30 +139,6 @@ def printstatus(status, name = ""):
# This is probably a can't-happen condition on Unix, but let's be defensive # This is probably a can't-happen condition on Unix, but let's be defensive
print "TEST-INFO | %s: undecodable exit status %04x\n" % (name, status) print "TEST-INFO | %s: undecodable exit status %04x\n" % (name, status)
def addCommonOptions(parser, defaults={}):
parser.add_option("--xre-path",
action = "store", type = "string", dest = "xrePath",
# individual scripts will set a sane default
default = None,
help = "absolute path to directory containing XRE (probably xulrunner)")
if 'SYMBOLS_PATH' not in defaults:
defaults['SYMBOLS_PATH'] = None
parser.add_option("--symbols-path",
action = "store", type = "string", dest = "symbolsPath",
default = defaults['SYMBOLS_PATH'],
help = "absolute path to directory containing breakpad symbols, or the URL of a zip file containing symbols")
parser.add_option("--debugger",
action = "store", dest = "debugger",
help = "use the given debugger to launch the application")
parser.add_option("--debugger-args",
action = "store", dest = "debuggerArgs",
help = "pass the given args to the debugger _before_ "
"the application on the command line")
parser.add_option("--debugger-interactive",
action = "store_true", dest = "debuggerInteractive",
help = "prevents the test harness from redirecting "
"stdout and stderr for interactive debuggers")
def dumpLeakLog(leakLogFile, filter = False): def dumpLeakLog(leakLogFile, filter = False):
"""Process the leak log, without parsing it. """Process the leak log, without parsing it.

Просмотреть файл

@ -22,7 +22,6 @@ SCRIPT_DIRECTORY = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])
sys.path.insert(0, SCRIPT_DIRECTORY) sys.path.insert(0, SCRIPT_DIRECTORY)
from automationutils import ( from automationutils import (
addCommonOptions,
dumpScreen, dumpScreen,
environment, environment,
processLeakLog processLeakLog
@ -618,8 +617,26 @@ class ReftestOptions(OptionParser):
def __init__(self): def __init__(self):
OptionParser.__init__(self) OptionParser.__init__(self)
defaults = {} defaults = {}
addCommonOptions(self) self.add_option("--xre-path",
action = "store", type = "string", dest = "xrePath",
# individual scripts will set a sane default
default = None,
help = "absolute path to directory containing XRE (probably xulrunner)")
self.add_option("--symbols-path",
action = "store", type = "string", dest = "symbolsPath",
default = None,
help = "absolute path to directory containing breakpad symbols, or the URL of a zip file containing symbols")
self.add_option("--debugger",
action = "store", dest = "debugger",
help = "use the given debugger to launch the application")
self.add_option("--debugger-args",
action = "store", dest = "debuggerArgs",
help = "pass the given args to the debugger _before_ "
"the application on the command line")
self.add_option("--debugger-interactive",
action = "store_true", dest = "debuggerInteractive",
help = "prevents the test harness from redirecting "
"stdout and stderr for interactive debuggers")
self.add_option("--appname", self.add_option("--appname",
action = "store", type = "string", dest = "app", action = "store", type = "string", dest = "app",
help = "absolute path to application, overriding default") help = "absolute path to application, overriding default")

Просмотреть файл

@ -9,7 +9,6 @@ import optparse
import os import os
import tempfile import tempfile
from automationutils import addCommonOptions
from mozprofile import DEFAULT_PORTS from mozprofile import DEFAULT_PORTS
here = os.path.abspath(os.path.dirname(__file__)) here = os.path.abspath(os.path.dirname(__file__))
@ -435,6 +434,35 @@ class MochitestOptions(optparse.OptionParser):
"dest": "gmp_path", "dest": "gmp_path",
"help": "Path to fake GMP plugin. Will be deduced from the binary if not passed.", "help": "Path to fake GMP plugin. Will be deduced from the binary if not passed.",
}], }],
[["--xre-path"],
{ "action": "store",
"type": "string",
"dest": "xrePath",
"default": None, # individual scripts will set a sane default
"help": "absolute path to directory containing XRE (probably xulrunner)",
}],
[["--symbols-path"],
{ "action": "store",
"type": "string",
"dest": "symbolsPath",
"default": None,
"help": "absolute path to directory containing breakpad symbols, or the URL of a zip file containing symbols",
}],
[["--debugger"],
{ "action": "store",
"dest": "debugger",
"help": "use the given debugger to launch the application",
}],
[["--debugger-args"],
{ "action": "store",
"dest": "debuggerArgs",
"help": "pass the given args to the debugger _before_ the application on the command line",
}],
[["--debugger-interactive"],
{ "action": "store_true",
"dest": "debuggerInteractive",
"help": "prevents the test harness from redirecting stdout and stderr for interactive debuggers",
}],
] ]
def __init__(self, **kwargs): def __init__(self, **kwargs):
@ -446,7 +474,6 @@ class MochitestOptions(optparse.OptionParser):
if "default" in value and isinstance(value["default"], list): if "default" in value and isinstance(value["default"], list):
value["default"] = [] value["default"] = []
self.add_option(*option, **value) self.add_option(*option, **value)
addCommonOptions(self)
self.set_usage(self.__doc__) self.set_usage(self.__doc__)
def verifyOptions(self, options, mochitest): def verifyOptions(self, options, mochitest):

Просмотреть файл

@ -39,7 +39,6 @@ except ImportError:
HAVE_PSUTIL = False HAVE_PSUTIL = False
from automation import Automation from automation import Automation
from automationutils import addCommonOptions
HARNESS_TIMEOUT = 5 * 60 HARNESS_TIMEOUT = 5 * 60
@ -1359,8 +1358,6 @@ class XPCShellOptions(OptionParser):
def __init__(self): def __init__(self):
"""Process command line arguments and call runTests() to do the real work.""" """Process command line arguments and call runTests() to do the real work."""
OptionParser.__init__(self) OptionParser.__init__(self)
addCommonOptions(self)
self.add_option("--app-path", self.add_option("--app-path",
type="string", dest="appPath", default=None, type="string", dest="appPath", default=None,
help="application directory (as opposed to XRE directory)") help="application directory (as opposed to XRE directory)")
@ -1417,6 +1414,26 @@ class XPCShellOptions(OptionParser):
self.add_option("--failure-manifest", dest="failureManifest", self.add_option("--failure-manifest", dest="failureManifest",
action="store", action="store",
help="path to file where failure manifest will be written.") help="path to file where failure manifest will be written.")
self.add_option("--xre-path",
action = "store", type = "string", dest = "xrePath",
# individual scripts will set a sane default
default = None,
help = "absolute path to directory containing XRE (probably xulrunner)")
self.add_option("--symbols-path",
action = "store", type = "string", dest = "symbolsPath",
default = None,
help = "absolute path to directory containing breakpad symbols, or the URL of a zip file containing symbols")
self.add_option("--debugger",
action = "store", dest = "debugger",
help = "use the given debugger to launch the application")
self.add_option("--debugger-args",
action = "store", dest = "debuggerArgs",
help = "pass the given args to the debugger _before_ "
"the application on the command line")
self.add_option("--debugger-interactive",
action = "store_true", dest = "debuggerInteractive",
help = "prevents the test harness from redirecting "
"stdout and stderr for interactive debuggers")
def main(): def main():
parser = XPCShellOptions() parser = XPCShellOptions()