Title: [249500] trunk/Tools
Revision
249500
Author
[email protected]
Date
2019-09-04 14:25:54 -0700 (Wed, 04 Sep 2019)

Log Message

run-api-tests: Add support for specifying additional environment variables
https://bugs.webkit.org/show_bug.cgi?id=201311
<rdar://problem/54852698>

Reviewed by Daniel Bates.

* Scripts/webkitpy/api_tests/run_api_tests.py:
(parse_args): Add --additional-env-var flag.
* Scripts/webkitpy/port/base.py:
(Port._append_value_colon_separated): Use os.pathsep instead of ':'.
(Port.environment_for_api_tests): Add the values from --additional-env-var to the
environment.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (249499 => 249500)


--- trunk/Tools/ChangeLog	2019-09-04 21:12:47 UTC (rev 249499)
+++ trunk/Tools/ChangeLog	2019-09-04 21:25:54 UTC (rev 249500)
@@ -1,3 +1,18 @@
+2019-09-04  Jonathan Bedard  <[email protected]>
+
+        run-api-tests: Add support for specifying additional environment variables
+        https://bugs.webkit.org/show_bug.cgi?id=201311
+        <rdar://problem/54852698>
+
+        Reviewed by Daniel Bates.
+
+        * Scripts/webkitpy/api_tests/run_api_tests.py:
+        (parse_args): Add --additional-env-var flag.
+        * Scripts/webkitpy/port/base.py:
+        (Port._append_value_colon_separated): Use os.pathsep instead of ':'.
+        (Port.environment_for_api_tests): Add the values from --additional-env-var to the
+        environment.
+
 2019-09-04  Aakash Jain  <[email protected]>
 
         EWS bubbles should indicate builder vs tester

Modified: trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py (249499 => 249500)


--- trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py	2019-09-04 21:12:47 UTC (rev 249499)
+++ trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py	2019-09-04 21:25:54 UTC (rev 249500)
@@ -136,6 +136,8 @@
 
         optparse.make_option('--force', action='', default=False,
                              help='Run all tests, even DISABLED tests'),
+        optparse.make_option('--additional-env-var', type='string', action='', default=[],
+                             help='Passes that environment variable to the tests (--additional-env-var=NAME=VALUE)'),
     ]))
     option_group_definitions.append(('Upload Options', upload_options()))
 

Modified: trunk/Tools/Scripts/webkitpy/port/base.py (249499 => 249500)


--- trunk/Tools/Scripts/webkitpy/port/base.py	2019-09-04 21:12:47 UTC (rev 249499)
+++ trunk/Tools/Scripts/webkitpy/port/base.py	2019-09-04 21:25:54 UTC (rev 249500)
@@ -267,13 +267,12 @@
 
     def environment_for_api_tests(self):
         build_root_path = str(self._build_path())
-        return {
-            'DYLD_LIBRARY_PATH': build_root_path,
-            '__XPC_DYLD_LIBRARY_PATH': build_root_path,
-            'DYLD_FRAMEWORK_PATH': build_root_path,
-            '__XPC_DYLD_FRAMEWORK_PATH': build_root_path,
-        }
+        environment = self.setup_environ_for_server()
+        for name in ['DYLD_LIBRARY_PATH', '__XPC_DYLD_LIBRARY_PATH', 'DYLD_FRAMEWORK_PATH', '__XPC_DYLD_FRAMEWORK_PATH']:
+            self._append_value_colon_separated(environment, name, build_root_path)
 
+        return environment
+
     def _check_driver(self):
         driver_path = self._path_to_driver()
         if not self._filesystem.exists(driver_path):
@@ -964,9 +963,9 @@
 
     @staticmethod
     def _append_value_colon_separated(env, name, value):
-        assert ":" not in value
+        assert os.pathsep not in value
         if name in env and env[name]:
-            env[name] = env[name] + ":" + value
+            env[name] = env[name] + os.pathsep + value
         else:
             env[name] = value
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to