diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-10-01 11:02:50 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-05-18 13:53:58 -0700 |
commit | cb6662b57299c3644719593115b2ffb828679c36 (patch) | |
tree | 27d15098799552bb16c501eafa7d4e5c807111fe /mesonbuild/backend/backends.py | |
parent | e822889754a3f9ba1a1c9d9179dd24d102db3969 (diff) | |
download | meson-cb6662b57299c3644719593115b2ffb828679c36.zip meson-cb6662b57299c3644719593115b2ffb828679c36.tar.gz meson-cb6662b57299c3644719593115b2ffb828679c36.tar.bz2 |
backends: ensure that test executables can be run when passed as arguments
If an executable is passed as an argument to a script in the build
directory that it resides in then it will not execute (on *nix) due to a
lack of ./. Ie, `foo` must be called as `./foo`. If it is called from a
different directory it will work. Ie `../foo` or `bar/foo`.
Fixes #5984
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 9d527cb..5ef7f44 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -810,6 +810,11 @@ class Backend: cmd_args.append(a) elif isinstance(a, str): cmd_args.append(a) + elif isinstance(a, build.Executable): + p = self.construct_target_rel_path(a, t.workdir) + if p == a.get_filename(): + p = './' + p + cmd_args.append(p) elif isinstance(a, build.Target): cmd_args.append(self.construct_target_rel_path(a, t.workdir)) else: |