Skip to content

Commit

Permalink
Bug 1619746 - Add --jsdebugger-path argument to mach test to specify …
Browse files Browse the repository at this point in the history
…a custom binary for the toolbox r=gbrown,ochameau

Differential Revision: https://phabricator.services.mozilla.com/D65206
  • Loading branch information
juliandescottes committed Mar 9, 2020
1 parent d7e1f2b commit 84544bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions testing/mochitest/mochitest_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,12 @@ class MochitestArguments(ArgumentContainer):
"default": False,
"help": "Start the browser JS debugger before running the test. Implies --no-autorun.",
}],
[["--jsdebugger-path"],
{"default": None,
"dest": "jsdebuggerPath",
"help": "Path to a Firefox binary that will be used to run the toolbox. Should "
"be used together with --jsdebugger."
}],
[["--debug-on-failure"],
{"action": "store_true",
"default": False,
Expand Down Expand Up @@ -717,6 +723,10 @@ def validate(self, parser, options, context):
parser.error(
"--debug-on-failure requires --jsdebugger.")

if options.jsdebuggerPath and not options.jsdebugger:
parser.error(
"--jsdebugger-path requires --jsdebugger.")

if options.debuggerArgs and not options.debugger:
parser.error(
"--debugger-args requires --debugger.")
Expand Down
7 changes: 6 additions & 1 deletion testing/mochitest/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,12 @@ def doTests(self, options, testsToFilter=None):
options.browserArgs.extend(['--jsconsole'])

if options.jsdebugger:
options.browserArgs.extend(['-jsdebugger', '-wait-for-jsdebugger'])
options.browserArgs.extend(['-wait-for-jsdebugger', '-jsdebugger'])

# -jsdebugger takes a binary path as an optional argument.
# Append jsdebuggerPath right after `-jsdebugger`.
if options.jsdebuggerPath:
options.browserArgs.extend([options.jsdebuggerPath])

# Remove the leak detection file so it can't "leak" to the tests run.
# The file is not there if leak logging was not enabled in the
Expand Down

0 comments on commit 84544bd

Please sign in to comment.