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
parent 2f6e302698
commit 2ce21ee428
5 changed files with 69 additions and 43 deletions

View File

@ -181,7 +181,6 @@ class Automation(object):
"log",
"runApp",
"Process",
"addCommonOptions",
"initializeProfile",
"DIST_BIN",
"DEFAULT_APP",
@ -385,15 +384,6 @@ class Automation(object):
proxy=proxy)
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):
pwfilePath = os.path.join(profileDir, ".crtdbpw")
pwfile = open(pwfilePath, "w")

View File

@ -18,7 +18,6 @@ import mozinfo
__all__ = [
"ZipFileReader",
"addCommonOptions",
"dumpLeakLog",
"processLeakLog",
'systemMemory',
@ -140,30 +139,6 @@ def printstatus(status, name = ""):
# 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)
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):
"""Process the leak log, without parsing it.

View File

@ -22,7 +22,6 @@ SCRIPT_DIRECTORY = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])
sys.path.insert(0, SCRIPT_DIRECTORY)
from automationutils import (
addCommonOptions,
dumpScreen,
environment,
processLeakLog
@ -618,8 +617,26 @@ class ReftestOptions(OptionParser):
def __init__(self):
OptionParser.__init__(self)
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",
action = "store", type = "string", dest = "app",
help = "absolute path to application, overriding default")

View File

@ -9,7 +9,6 @@ import optparse
import os
import tempfile
from automationutils import addCommonOptions
from mozprofile import DEFAULT_PORTS
here = os.path.abspath(os.path.dirname(__file__))
@ -435,6 +434,35 @@ class MochitestOptions(optparse.OptionParser):
"dest": "gmp_path",
"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):
@ -446,7 +474,6 @@ class MochitestOptions(optparse.OptionParser):
if "default" in value and isinstance(value["default"], list):
value["default"] = []
self.add_option(*option, **value)
addCommonOptions(self)
self.set_usage(self.__doc__)
def verifyOptions(self, options, mochitest):

View File

@ -39,7 +39,6 @@ except ImportError:
HAVE_PSUTIL = False
from automation import Automation
from automationutils import addCommonOptions
HARNESS_TIMEOUT = 5 * 60
@ -1359,8 +1358,6 @@ class XPCShellOptions(OptionParser):
def __init__(self):
"""Process command line arguments and call runTests() to do the real work."""
OptionParser.__init__(self)
addCommonOptions(self)
self.add_option("--app-path",
type="string", dest="appPath", default=None,
help="application directory (as opposed to XRE directory)")
@ -1417,6 +1414,26 @@ class XPCShellOptions(OptionParser):
self.add_option("--failure-manifest", dest="failureManifest",
action="store",
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():
parser = XPCShellOptions()