Fix run-webkit-tests --additional-env-var="DYLD_INSERT_LIBRARIES=..."
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Aug 2015 22:50:43 +0000 (22:50 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Aug 2015 22:50:43 +0000 (22:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148592

Reviewed by Tim Horton.

* Scripts/webkitpy/port/base.py:
(Port.to.setup_environ_for_server):
(Port.to):
(Port.to._append_value_colon_separated):
(Port.to.show_results_html_file):
* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.setup_environ_for_server):
* Scripts/webkitpy/port/mac.py:
(MacPort.setup_environ_for_server):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/port/base.py
Tools/Scripts/webkitpy/port/ios.py
Tools/Scripts/webkitpy/port/mac.py

index f7af04d..17c0dfd 100644 (file)
@@ -1,3 +1,20 @@
+2015-08-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Fix run-webkit-tests --additional-env-var="DYLD_INSERT_LIBRARIES=..."
+        https://bugs.webkit.org/show_bug.cgi?id=148592
+
+        Reviewed by Tim Horton.
+
+        * Scripts/webkitpy/port/base.py:
+        (Port.to.setup_environ_for_server):
+        (Port.to):
+        (Port.to._append_value_colon_separated):
+        (Port.to.show_results_html_file):
+        * Scripts/webkitpy/port/ios.py:
+        (IOSSimulatorPort.setup_environ_for_server):
+        * Scripts/webkitpy/port/mac.py:
+        (MacPort.setup_environ_for_server):
+
 2015-08-28  Filip Pizlo  <fpizlo@apple.com>
 
         LICM should be sound even if the CFG has changed
index 2cac515..e8e2f54 100644 (file)
@@ -853,6 +853,14 @@ class Port(object):
 
         return clean_env
 
+    @staticmethod
+    def _append_value_colon_separated(env, name, value):
+        assert ":" not in value
+        if name in env and env[name]:
+            env[name] = env[name] + ":" + value
+        else:
+            env[name] = value
+
     def show_results_html_file(self, results_filename):
         """This routine should display the HTML file pointed at by
         results_filename in a users' browser."""
index 5db70ec..23c4af5 100644 (file)
@@ -231,9 +231,8 @@ class IOSSimulatorPort(Port):
             if self.get_option('leaks'):
                 env['MallocStackLogging'] = '1'
             if self.get_option('guard_malloc'):
-                env['DYLD_INSERT_LIBRARIES'] = '/usr/lib/libgmalloc.dylib:' + self._build_path("libWebCoreTestShim.dylib")
-            else:
-                env['DYLD_INSERT_LIBRARIES'] = self._build_path("libWebCoreTestShim.dylib")
+                self._append_value_colon_separated(env, 'DYLD_INSERT_LIBRARIES', '/usr/lib/libgmalloc.dylib')
+            self._append_value_colon_separated(env, 'DYLD_INSERT_LIBRARIES', self._build_path("libWebCoreTestShim.dylib"))
         env['XML_CATALOG_FILES'] = ''  # work around missing /etc/catalog <rdar://problem/4292995>
         return env
 
index 89f74d2..0c5bfe9 100644 (file)
@@ -102,9 +102,8 @@ class MacPort(ApplePort):
             if self.get_option('leaks'):
                 env['MallocStackLogging'] = '1'
             if self.get_option('guard_malloc'):
-                env['DYLD_INSERT_LIBRARIES'] = '/usr/lib/libgmalloc.dylib:' + self._build_path("libWebCoreTestShim.dylib")
-            else:
-                env['DYLD_INSERT_LIBRARIES'] = self._build_path("libWebCoreTestShim.dylib")
+                self._append_value_colon_separated(env, 'DYLD_INSERT_LIBRARIES', '/usr/lib/libgmalloc.dylib')
+            self._append_value_colon_separated(env, 'DYLD_INSERT_LIBRARIES', self._build_path("libWebCoreTestShim.dylib"))
         env['XML_CATALOG_FILES'] = ''  # work around missing /etc/catalog <rdar://problem/4292995>
         return env