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/.
5 from __future__
import absolute_import
9 from mozlog
import commandline
12 def add_common_arguments(parser
):
18 help="application directory (as opposed to XRE directory)",
25 help="don't automatically run tests, drop to an xpcshell prompt",
32 help="always print stdout and stderr from tests",
37 dest
="verboseIfFails",
39 help="Output the log if a test fails, even when run in parallel",
46 help="continue running tests after test killed with control-C (SIGINT)",
53 help="create log files (default, only used to override --no-logfiles)",
60 help="Specify path to a filename to dump all the tests that will be run",
67 help="Manifest of test directories to use",
73 help="don't create log files",
80 help="Run all tests sequentially",
86 help="Directory to use for temporary files",
89 "--testing-modules-dir",
90 dest
="testingModulesDir",
92 help="Directory where testing modules are located.",
99 help="Path to the location of a plugins directory containing the "
100 "test plugin or plugins required for tests. "
101 "By default xpcshell's dir svc provider returns gre/plugins. "
102 "Use test-plugin-path to add a directory "
103 "to return for NS_APP_PLUGINS_DIR_LIST when queried.",
110 help="how many chunks to split the tests up into",
117 help="which chunk to run between 1 and --total-chunks",
124 help="name of application profile being tested",
131 help="path to a mozinfo.json including information about the build "
132 "configuration. defaults to looking for mozinfo.json next to "
140 help="Execute tests in random order",
147 # individual scripts will set a sane default
149 help="absolute path to directory containing XRE (probably xulrunner)",
157 help="absolute path to directory containing breakpad symbols, "
158 "or the URL of a zip file containing symbols",
161 "--jscov-dir-prefix",
165 default
=argparse
.SUPPRESS
,
166 help="Directory to store per-test javascript line coverage data as json.",
172 help="use the given debugger to launch the application",
178 help="pass the given args to the debugger _before_ "
179 "the application on the command line",
182 "--debugger-interactive",
184 dest
="debuggerInteractive",
185 help="prevents the test harness from redirecting "
186 "stdout and stderr for interactive debuggers",
192 help="Waits for a devtools JS debugger to connect before " "starting the test.",
197 dest
="jsDebuggerPort",
199 help="The port to listen on for a debugger connection if "
200 "--jsdebugger is specified.",
207 help="filter out tests that don't have the given tag. Can be "
208 "used multiple times in which case the test must contain "
209 "at least one of the given tags.",
216 help="Path to a directory containing utility programs, such "
217 "as stack fixer scripts.",
224 help="Path to xpcshell binary",
231 help="Path to http3server binary",
233 # This argument can be just present, or the path to a manifest file. The
234 # just-present case is usually used for mach which can provide a default
235 # path to the failure file from the previous run
239 help="Rerun failures from the previous run, if any",
242 "--failure-manifest",
244 help="Path to a manifest file from which to rerun failures "
245 "(with --rerun-failure) or in which to record failed tests",
252 help="override the number of jobs (threads) when running tests "
253 "in parallel, the default is CPU x 1.5 when running via mach "
254 "and CPU x 4 when running in automation",
260 metavar
="PREF=VALUE",
261 help="Defines an extra user preference (can be passed multiple times.",
264 "testPaths", nargs
="*", default
=None, help="Paths of tests to run."
270 help="Run tests in verification mode: Run many times in different "
271 "ways, to see if there are intermittent failures.",
275 dest
="verifyMaxTime",
278 help="Maximum time, in seconds, to run in --verify mode.",
285 help="Enable headless mode by default for tests which don't specify "
286 "whether to use headless mode",
289 "--conditioned-profile",
292 dest
="conditionedProfile",
293 help="Run with conditioned profile instead of fresh blank profile",
300 help="Run self tests",
307 help="Run failures matching keyword",
313 dest
="timeoutAsPass",
314 help="Harness level timeouts will be treated as passing",
321 help="Harness level crashes will be treated as passing",
327 dest
="disableFission",
328 help="disable fission mode (back to e10s || 1proc)",
332 def add_remote_arguments(parser
):
338 help="Local objdir, containing xpcshell binaries.",
346 help="Local path to Firefox for Android APK.",
354 help="adb serial number of remote device. This is required "
355 "when more than one device is connected to the host. "
356 "Use 'adb devices' to see connected devices.",
365 help="Path to adb binary.",
370 action
="store_false",
373 help="Do not copy any files to device (to be used only if "
374 "device is already setup).",
378 action
="store_false",
381 help="Don't install the app or any files to the device (to be used if "
382 "the device is already set up)",
390 help="Local path to bin directory.",
397 dest
="remoteTestRoot",
398 help="Remote directory to use as test root " "(eg. /data/local/tmp/test_root).",
402 def parser_desktop():
403 parser
= argparse
.ArgumentParser()
404 add_common_arguments(parser
)
405 commandline
.add_logging_group(parser
)
411 parser
= argparse
.ArgumentParser()
412 common
= parser
.add_argument_group("Common Options")
413 add_common_arguments(common
)
414 remote
= parser
.add_argument_group("Remote Options")
415 add_remote_arguments(remote
)
416 commandline
.add_logging_group(parser
)