Bug 1263506 - Ensure MOZ_GMP_PATH in gtests always has native dir separators. r=glandium
authorChris Pearce <cpearce@mozilla.com>
Tue, 12 Apr 2016 16:12:19 +1200
changeset 292711 d8d50064c15b51ccdeae349dca3b0a83e567487e
parent 292710 927fe582c13f5406cc7c2af7b0dbe1b3ce99f57e
child 292712 990f372ef96d9e51c975672a37793e8675966275
push id74962
push usercpearce@mozilla.com
push dateTue, 12 Apr 2016 04:14:58 +0000
treeherdermozilla-inbound@85a28619dd12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1263506
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1263506 - Ensure MOZ_GMP_PATH in gtests always has native dir separators. r=glandium 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
@@ -903,17 +903,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"