Bug 876732 - Add a way to pass debugger args when using `mach mochitest`. r=ted

This commit is contained in:
Paul Adenot 2013-05-30 17:00:46 +02:00
Родитель 54aa4ccd06
Коммит 0d5032907c
1 изменённых файлов: 14 добавлений и 2 удалений

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

@ -37,8 +37,8 @@ class MochitestRunner(MozbuildObject):
to hook up result parsing, etc.
"""
def run_mochitest_test(self, suite=None, test_file=None, debugger=None,
shuffle=False, keep_open=False, rerun_failures=False, no_autorun=False,
repeat=0, run_until_failure=False, slow=False):
debugger_args=None, shuffle=False, keep_open=False, rerun_failures=False,
no_autorun=False, repeat=0, run_until_failure=False, slow=False):
"""Runs a mochitest.
test_file is a path to a test file. It can be a relative path from the
@ -51,6 +51,8 @@ class MochitestRunner(MozbuildObject):
debugger is a program name or path to a binary (presumably a debugger)
to run the test in. e.g. 'gdb'
debugger_args are the arguments passed to the debugger.
shuffle is whether test order should be shuffled (defaults to false).
keep_open denotes whether to keep the browser open after tests
@ -155,6 +157,12 @@ class MochitestRunner(MozbuildObject):
if debugger:
options.debugger = debugger
if debugger_args:
if options.debugger == None:
print("--debugger-args passed, but no debugger specified.")
return 1
options.debuggerArgs = debugger_args
options = opts.verifyOptions(options, runner)
if options is None:
@ -207,6 +215,10 @@ def MochitestCommand(func):
help='Debugger binary to run test in. Program name or path.')
func = debugger(func)
debugger_args = CommandArgument('--debugger-args',
metavar='DEBUGGER_ARGS', help='Arguments to pass to the debugger.')
func = debugger_args(func)
shuffle = CommandArgument('--shuffle', action='store_true',
help='Shuffle execution order.')
func = shuffle(func)