Bug 816079 - Add --gecko-path and --logcat-dir options to b2g xpcshell harness, r=jgriffin, DONTBUILD a=NPOTB,test-only
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 28 Nov 2012 14:32:34 -0500
changeset 114755 6289f763c7aa93870d0920c314fc3c34214a37ff
parent 114754 abfc930bc7cd5d76974f6b9c2b45b9e372094577
child 114756 d8fb7a8bdae1b6f5110944eabff75634a85e2769
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersjgriffin, DONTBUILD, NPOTB, test-only
bugs816079
milestone20.0a1
Bug 816079 - Add --gecko-path and --logcat-dir options to b2g xpcshell harness, r=jgriffin, DONTBUILD a=NPOTB,test-only
testing/xpcshell/runtestsb2g.py
--- a/testing/xpcshell/runtestsb2g.py
+++ b/testing/xpcshell/runtestsb2g.py
@@ -103,16 +103,25 @@ class B2GOptions(RemoteXPCShellOptions):
                         type='string', dest='address',
                         help="host:port of running Gecko instance to connect to")
         defaults['address'] = None
 
         self.add_option('--use-device-libs', action='store_true',
                         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
         defaults['debuggerArgs'] = None
 
         self.set_defaults(**defaults)
 
 
@@ -121,22 +130,32 @@ def main():
     options, args = parser.parse_args()
 
     if options.b2g_path is None:
         parser.error("Need to specify a --b2gpath")
 
     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:
         host, port = options.address.split(':')
         kwargs['host'] = host
         kwargs['port'] = int(port)
         kwargs['baseurl'] = 'http://%s:%d/' % (host, int(port))
         if options.emulator: