Commit 366a85e6 authored by Andrew Halberstadt's avatar Andrew Halberstadt
Browse files

Bug 816079 - Add --gecko-path and --logcat-dir options to b2g xpcshell...

Bug 816079 - Add --gecko-path and --logcat-dir options to b2g xpcshell harness, r=jgriffin, DONTBUILD a=NPOTB,test-only
parent 7052c26c
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -108,6 +108,15 @@ class B2GOptions(RemoteXPCShellOptions):
                        dest='use_device_libs',
                        help="Don't push .so's")
        defaults['use_device_libs'] = False
        self.add_option("--gecko-path", action="store",
                        type="string", dest="geckoPath",
                        help="the path to a gecko distribution that should "
                        "be installed on the emulator prior to test")
        defaults["geckoPath"] = None
        self.add_option("--logcat-dir", action="store",
                        type="string", dest="logcat_dir",
                        help="directory to store logcat dump files")
        defaults["logcat_dir"] = None

        defaults['dm_trans'] = 'adb'
        defaults['debugger'] = None
@@ -126,12 +135,22 @@ def main():
    if options.xrePath is None:
        parser.error("Need to specify a --xre-path")

    if options.geckoPath and not options.emulator:
        self.error("You must specify --emulator if you specify --gecko-path")

    if options.logcat_dir and not options.emulator:
        self.error("You must specify --emulator if you specify --logcat-dir")

    # Create the Marionette instance
    kwargs = {}
    if options.emulator:
        kwargs['emulator'] = options.emulator
        if options.no_window:
            kwargs['noWindow'] = True
        if options.geckoPath:
            kwargs['gecko_path'] = options.geckoPath
        if options.logcat_dir:
            kwargs['logcat_dir'] = options.logcat_dir
    if options.b2g_path:
        kwargs['homedir'] = options.emu_path or options.b2g_path
    if options.address: