1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from mozlog
import commandline
10 def add_common_arguments(parser
):
16 help="path to application binary (eg: c:\\program files\\mozilla firefox\\firefox.exe)",
23 help="application directory (as opposed to XRE directory)",
30 help="don't automatically run tests, drop to an xpcshell prompt",
37 help="always print stdout and stderr from tests",
42 dest
="verboseIfFails",
44 help="Output the log if a test fails, even when run in parallel",
51 help="continue running tests after test killed with control-C (SIGINT)",
58 help="create log files (default, only used to override --no-logfiles)",
65 help="Specify path to a filename to dump all the tests that will be run",
72 help="Manifest of test directories to use",
78 help="don't create log files",
85 help="Run all tests sequentially",
91 help="Directory to use for temporary files",
94 "--testing-modules-dir",
95 dest
="testingModulesDir",
97 help="Directory where testing modules are located.",
104 help="how many chunks to split the tests up into",
111 help="which chunk to run between 1 and --total-chunks",
118 help="name of application profile being tested",
125 help="path to a mozinfo.json including information about the build "
126 "configuration. defaults to looking for mozinfo.json next to "
134 help="Execute tests in random order",
141 # individual scripts will set a sane default
143 help="absolute path to directory containing XRE (probably xulrunner)",
151 help="absolute path to directory containing breakpad symbols, "
152 "or the URL of a zip file containing symbols",
155 "--jscov-dir-prefix",
159 default
=argparse
.SUPPRESS
,
160 help="Directory to store per-test javascript line coverage data as json.",
166 help="use the given debugger to launch the application",
172 help="pass the given args to the debugger _before_ "
173 "the application on the command line",
176 "--debugger-interactive",
178 dest
="debuggerInteractive",
179 help="prevents the test harness from redirecting "
180 "stdout and stderr for interactive debuggers",
186 help="Waits for a devtools JS debugger to connect before " "starting the test.",
191 dest
="jsDebuggerPort",
193 help="The port to listen on for a debugger connection if "
194 "--jsdebugger is specified.",
201 help="filter out tests that don't have the given tag. Can be "
202 "used multiple times in which case the test must contain "
203 "at least one of the given tags.",
210 help="Path to a directory containing utility programs, such "
211 "as stack fixer scripts.",
218 help="Path to xpcshell binary",
225 help="Path to http3server binary",
227 # This argument can be just present, or the path to a manifest file. The
228 # just-present case is usually used for mach which can provide a default
229 # path to the failure file from the previous run
233 help="Rerun failures from the previous run, if any",
236 "--failure-manifest",
238 help="Path to a manifest file from which to rerun failures "
239 "(with --rerun-failure) or in which to record failed tests",
246 help="override the number of jobs (threads) when running tests "
247 "in parallel, the default is CPU x 1.5 when running via mach "
248 "and CPU x 4 when running in automation",
254 metavar
="PREF=VALUE",
255 help="Defines an extra user preference (can be passed multiple times.",
258 "testPaths", nargs
="*", default
=None, help="Paths of tests to run."
264 help="Run tests in verification mode: Run many times in different "
265 "ways, to see if there are intermittent failures.",
269 dest
="verifyMaxTime",
272 help="Maximum time, in seconds, to run in --verify mode.",
279 help="Enable headless mode by default for tests which don't specify "
280 "whether to use headless mode",
283 "--conditioned-profile",
286 dest
="conditionedProfile",
287 help="Run with conditioned profile instead of fresh blank profile",
294 help="Run self tests",
301 help="Run failures matching keyword",
307 dest
="timeoutAsPass",
308 help="Harness level timeouts will be treated as passing",
315 help="Harness level crashes will be treated as passing",
321 dest
="disableFission",
322 help="disable fission mode (back to e10s || 1proc)",
330 help="repeat the test X times, default [0]",
334 def add_remote_arguments(parser
):
340 help="Local objdir, containing xpcshell binaries.",
348 help="Local path to Firefox for Android APK.",
356 help="adb serial number of remote device. This is required "
357 "when more than one device is connected to the host. "
358 "Use 'adb devices' to see connected devices.",
367 help="Path to adb binary.",
372 action
="store_false",
375 help="Do not copy any files to device (to be used only if "
376 "device is already setup).",
380 action
="store_false",
383 help="Don't install the app or any files to the device (to be used if "
384 "the device is already set up)",
392 help="Local path to bin directory.",
399 dest
="remoteTestRoot",
400 help="Remote directory to use as test root " "(eg. /data/local/tmp/test_root).",
404 def parser_desktop():
405 parser
= argparse
.ArgumentParser()
406 add_common_arguments(parser
)
407 commandline
.add_logging_group(parser
)
413 parser
= argparse
.ArgumentParser()
414 common
= parser
.add_argument_group("Common Options")
415 add_common_arguments(common
)
416 remote
= parser
.add_argument_group("Remote Options")
417 add_remote_arguments(remote
)
418 commandline
.add_logging_group(parser
)