From 0ec94ca0629415d4b555e8ef38a5093a65e0539e Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 1 Oct 2019 11:19:08 -0700 Subject: backends: Consider arguments passed to a test when cross compiling Otherwise a wrapper script which takes an executable as an argument will mistakenly run when that executable is cross compiled. This does not wrap said executable in an exe_wrapper, just skip it. Fixes #5982 --- mesonbuild/mtest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mesonbuild/mtest.py') diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index e04d365..8806932 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -615,14 +615,15 @@ class SingleTestRunner: # Can not run test on cross compiled executable # because there is no execute wrapper. return None - else: + 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(): 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 - else: - return self.test.fname + return self.test.fname def run(self) -> TestRun: cmd = self._get_cmd() -- cgit v1.1