Bug 1057328 - Get gmp path for app-override tests. r=ted, a=test-only
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 22 Aug 2014 16:28:04 +0200
changeset 217733 ee3f447df950925334ee031d15fbe135acb7002f
parent 217732 104c671afe110c6c4200b4fc7cba0c8d63824b13
child 217734 93fa2a38c5d54ad97470bbd0f8639b153cc57175
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, test-only
bugs1057328
milestone33.0a2
Bug 1057328 - Get gmp path for app-override tests. r=ted, a=test-only
testing/mochitest/mach_commands.py
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -352,20 +352,26 @@ class MochitestRunner(MozbuildObject):
             options.debugger = debugger
 
         if debugger_args:
             if options.debugger == None:
                 print("--debugger-args passed, but no debugger specified.")
                 return 1
             options.debuggerArgs = debugger_args
 
-        if app_override == "dist":
-            options.app = self.get_binary_path(where='staged-package')
-        elif app_override:
-            options.app = app_override
+        if app_override:
+            if app_override == "dist":
+                options.app = self.get_binary_path(where='staged-package')
+            elif app_override:
+                options.app = app_override
+            if options.gmp_path is None:
+                # Need to fix the location of gmp_fake which might not be shipped in the binary
+                bin_path = self.get_binary_path()
+                options.gmp_path = os.path.join(os.path.dirname(bin_path), 'gmp-fake')
+
 
         logger_options = {key: value for key, value in vars(options).iteritems() if key.startswith('log')}
         runner = mochitest.Mochitest(logger_options)
         options = opts.verifyOptions(options, runner)
 
         if options is None:
             raise Exception('mochitest option validator failed.')
 
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -424,16 +424,22 @@ class MochitestOptions(optparse.OptionPa
           "default": "",
         }],
         [["--use-test-media-devices"],
         { "action": "store_true",
           "default": False,
           "dest": "useTestMediaDevices",
           "help": "Use test media device drivers for media testing.",
         }],
+        [["--gmp-path"],
+        { "action": "store",
+          "default": None,
+          "dest": "gmp_path",
+          "help": "Path to fake GMP plugin. Will be deduced from the binary if not passed.",
+        }],
     ]
 
     def __init__(self, **kwargs):
 
         optparse.OptionParser.__init__(self, **kwargs)
         for option, value in self.mochitest_options:
             # Allocate new lists so references to original don't get mutated.
             # allowing multiple uses within a single process.
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1152,16 +1152,19 @@ class Mochitest(MochitestUtilsMixin):
     certificateStatus = self.fillCertificateDB(options)
     if certificateStatus:
       self.log.error("TEST-UNEXPECTED-FAIL | runtests.py | Certificate integration failed")
       return None
 
     return manifest
 
   def getGMPPluginPath(self, options):
+    if options.gmp_path:
+      return options.gmp_path
+
     # For local builds, gmp-fake will be under dist/bin.
     gmp_path = os.path.join(options.xrePath, 'gmp-fake')
     if os.path.isdir(gmp_path):
       return gmp_path
 
     # For packaged builds, gmp-fake will get copied under $profile/plugins.
     gmp_path = os.path.join(self.profile.profile, 'plugins', 'gmp-fake')
     if os.path.isdir(gmp_path):