rename exe_runner to exe_wrapper everywhere

I don't understand the purpose of this confusing API naming split.
pull/9701/head
Eli Schwartz 3 years ago
parent 4b2c54569d
commit 5b7d4f8bd3
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 6
      mesonbuild/backend/backends.py
  2. 12
      mesonbuild/mtest.py
  3. 12
      mesonbuild/scripts/meson_exe.py

@ -203,7 +203,7 @@ class ExecutableSerialisation:
self.env = env
if exe_wrapper is not None:
assert isinstance(exe_wrapper, programs.ExternalProgram)
self.exe_runner = exe_wrapper
self.exe_wrapper = exe_wrapper
self.workdir = workdir
self.extra_paths = extra_paths
self.capture = capture
@ -229,7 +229,7 @@ class TestSerialisation:
self.is_cross_built = is_cross_built
if exe_wrapper is not None:
assert isinstance(exe_wrapper, programs.ExternalProgram)
self.exe_runner = exe_wrapper
self.exe_wrapper = exe_wrapper
self.is_parallel = is_parallel
self.cmd_args = cmd_args
self.env = env
@ -617,7 +617,7 @@ class Backend:
if es.extra_paths:
reasons.append('to set PATH')
if es.exe_runner:
if es.exe_wrapper:
reasons.append('to use exe_wrapper')
if workdir:

@ -1350,18 +1350,18 @@ class SingleTestRunner:
elif not self.test.is_cross_built and run_with_mono(self.test.fname[0]):
return ['mono'] + self.test.fname
elif self.test.cmd_is_built and self.test.is_cross_built and self.test.needs_exe_wrapper:
if self.test.exe_runner is None:
if self.test.exe_wrapper is None:
# Can not run test on cross compiled executable
# because there is no execute wrapper.
return None
elif self.test.cmd_is_built:
# If the command is not built (ie, its a python script),
# then we don't check for the exe-wrapper
if not self.test.exe_runner.found():
if not self.test.exe_wrapper.found():
msg = ('The exe_wrapper defined in the cross file {!r} was not '
'found. Please check the command and/or add it to PATH.')
raise TestException(msg.format(self.test.exe_runner.name))
return self.test.exe_runner.get_command() + self.test.fname
raise TestException(msg.format(self.test.exe_wrapper.name))
return self.test.exe_wrapper.get_command() + self.test.fname
return self.test.fname
def _get_cmd(self) -> T.Optional[T.List[str]]:
@ -1575,8 +1575,8 @@ class TestHarness:
test_env = test.env.get_env(env)
env.update(test_env)
if (test.is_cross_built and test.needs_exe_wrapper and
test.exe_runner and test.exe_runner.found()):
env['MESON_EXE_WRAPPER'] = join_args(test.exe_runner.get_command())
test.exe_wrapper and test.exe_wrapper.found()):
env['MESON_EXE_WRAPPER'] = join_args(test.exe_wrapper.get_command())
return SingleTestRunner(test, env, name, options)
def process_test_result(self, result: TestRun) -> None:

@ -33,11 +33,11 @@ def buildparser() -> argparse.ArgumentParser:
return parser
def run_exe(exe: ExecutableSerialisation, extra_env: T.Optional[T.Dict[str, str]] = None) -> int:
if exe.exe_runner:
if not exe.exe_runner.found():
if exe.exe_wrapper:
if not exe.exe_wrapper.found():
raise AssertionError('BUG: Can\'t run cross-compiled exe {!r} with not-found '
'wrapper {!r}'.format(exe.cmd_args[0], exe.exe_runner.get_path()))
cmd_args = exe.exe_runner.get_command() + exe.cmd_args
'wrapper {!r}'.format(exe.cmd_args[0], exe.exe_wrapper.get_path()))
cmd_args = exe.exe_wrapper.get_command() + exe.cmd_args
else:
cmd_args = exe.cmd_args
child_env = os.environ.copy()
@ -48,9 +48,9 @@ def run_exe(exe: ExecutableSerialisation, extra_env: T.Optional[T.Dict[str, str]
if exe.extra_paths:
child_env['PATH'] = (os.pathsep.join(exe.extra_paths + ['']) +
child_env['PATH'])
if exe.exe_runner and mesonlib.substring_is_in_list('wine', exe.exe_runner.get_command()):
if exe.exe_wrapper and mesonlib.substring_is_in_list('wine', exe.exe_wrapper.get_command()):
child_env['WINEPATH'] = mesonlib.get_wine_shortpath(
exe.exe_runner.get_command(),
exe.exe_wrapper.get_command(),
['Z:' + p for p in exe.extra_paths] + child_env.get('WINEPATH', '').split(';')
)

Loading…
Cancel
Save