Bug 1263506 - Ensure MOZ_GMP_PATH in gtests always has native dir separators. r=glandium, a=ritu
authorChris Pearce <cpearce@mozilla.com>
Tue, 12 Apr 2016 16:12:19 +1200
changeset 325918 04ac010a94861369bc8d8a039ab7ddd0136127ad
parent 325917 dc8dd10e7a95e36e73b1a3c0a9fd6599047ff6a7
child 325919 89d0d3749675100aab0c87782f94100dcb2563ae
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, ritu
bugs1263506
milestone47.0a2
Bug 1263506 - Ensure MOZ_GMP_PATH in gtests always has native dir separators. r=glandium, a=ritu Without this, the GeckoMediaPlugin gtests fail, as the GMP stack is unable to load GMPs from disk. MozReview-Commit-ID: GGXdm2L5IF9
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -898,17 +898,20 @@ class GTestCommands(MachCommandBase):
         if not os.path.isdir(cwd):
             os.makedirs(cwd)
 
         # Use GTest environment variable to control test execution
         # For details see:
         # https://code.google.com/p/googletest/wiki/AdvancedGuide#Running_Test_Programs:_Advanced_Options
         gtest_env = {b'GTEST_FILTER': gtest_filter}
 
-        xre_path = os.path.join(self.topobjdir, "dist", "bin")
+        # Note: we must normalize the path here so that gtest on Windows sees
+        # a MOZ_GMP_PATH which has only Windows dir seperators, because
+        # nsILocalFile cannot open the paths with non-Windows dir seperators.
+        xre_path = os.path.join(os.path.normpath(self.topobjdir), "dist", "bin")
         gtest_env["MOZ_XRE_DIR"] = xre_path
         gtest_env["MOZ_GMP_PATH"] = os.pathsep.join(
             os.path.join(xre_path, p, "1.0")
             for p in ('gmp-fake', 'gmp-fakeopenh264')
         )
 
         gtest_env[b"MOZ_RUN_GTEST"] = b"True"