aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-11 04:13:58 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2022-03-14 01:48:16 +0200
commit4680c09aac3dc97436357ba6c8a7ac64132a1830 (patch)
tree17142f68ca4f800be99a914d1ff059f7dd556d5f /mesonbuild/backend/backends.py
parente54e9f58e5dce61573a96bdbef2bc3528566589e (diff)
downloadmeson-4680c09aac3dc97436357ba6c8a7ac64132a1830.zip
meson-4680c09aac3dc97436357ba6c8a7ac64132a1830.tar.gz
meson-4680c09aac3dc97436357ba6c8a7ac64132a1830.tar.bz2
mtest: fix logic bug that broke tests where the cmd is a Windows found program
In this case, the test fname might have an implicit extension and cannot be found by `os.path.isfile()`. We cannot use `shutil.which()` to handle platform differences, because not all test fnames are executable -- for example Java jars. The test representation does have an "is built" attribute which in theory should work here, because all built targets definitely have their full filename known to Meson, but it turns out to be misnamed. Rename it correctly and add an actual "is built" attribute to check. Tests which aren't built by Meson can be assumed to exist without consulting their existence on the filesystem. Fixes #10027
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 6a78ed0..fbcb616 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -224,6 +224,7 @@ class TestSerialisation:
protocol: TestProtocol
priority: int
cmd_is_built: bool
+ cmd_is_exe: bool
depends: T.List[str]
version: str
verbose: bool
@@ -1147,6 +1148,7 @@ class Backend:
t.is_parallel, cmd_args, t.env,
t.should_fail, t.timeout, t.workdir,
extra_paths, t.protocol, t.priority,
+ isinstance(exe, build.Target),
isinstance(exe, build.Executable),
[x.get_id() for x in depends],
self.environment.coredata.version,