⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249500 in webkit


Ignore:
Timestamp:
Sep 4, 2019, 2:25:54 PM (7 years ago)
Author:
Jonathan Bedard
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.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r249483 r249500  
     12019-09-04  Jonathan Bedard  <jbedard@apple.com>
     2
     3        run-api-tests: Add support for specifying additional environment variables
     4        https://bugs.webkit.org/show_bug.cgi?id=201311
     5        <rdar://problem/54852698>
     6
     7        Reviewed by Daniel Bates.
     8
     9        * Scripts/webkitpy/api_tests/run_api_tests.py:
     10        (parse_args): Add --additional-env-var flag.
     11        * Scripts/webkitpy/port/base.py:
     12        (Port._append_value_colon_separated): Use os.pathsep instead of ':'.
     13        (Port.environment_for_api_tests): Add the values from --additional-env-var to the
     14        environment.
     15
    1162019-09-04  Aakash Jain  <aakash_jain@apple.com>
    217
  • trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py

    r244942 r249500  
    137137        optparse.make_option('--force', action='store_true', default=False,
    138138                             help='Run all tests, even DISABLED tests'),
     139        optparse.make_option('--additional-env-var', type='string', action='append', default=[],
     140                             help='Passes that environment variable to the tests (--additional-env-var=NAME=VALUE)'),
    139141    ]))
    140142    option_group_definitions.append(('Upload Options', upload_options()))
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r246637 r249500  
    268268    def environment_for_api_tests(self):
    269269        build_root_path = str(self._build_path())
    270         return {
    271             'DYLD_LIBRARY_PATH': build_root_path,
    272             '__XPC_DYLD_LIBRARY_PATH': build_root_path,
    273             'DYLD_FRAMEWORK_PATH': build_root_path,
    274             '__XPC_DYLD_FRAMEWORK_PATH': build_root_path,
    275         }
     270        environment = self.setup_environ_for_server()
     271        for name in ['DYLD_LIBRARY_PATH', '__XPC_DYLD_LIBRARY_PATH', 'DYLD_FRAMEWORK_PATH', '__XPC_DYLD_FRAMEWORK_PATH']:
     272            self._append_value_colon_separated(environment, name, build_root_path)
     273
     274        return environment
    276275
    277276    def _check_driver(self):
     
    965964    @staticmethod
    966965    def _append_value_colon_separated(env, name, value):
    967         assert ":" not in value
     966        assert os.pathsep not in value
    968967        if name in env and env[name]:
    969             env[name] = env[name] + ":" + value
     968            env[name] = env[name] + os.pathsep + value
    970969        else:
    971970            env[name] = value
Note: See TracChangeset for help on using the changeset viewer.