diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-03-07 10:18:24 +0100 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-04-24 17:52:13 +0300 |
| commit | fc9fd42899e1e2160a69ec245931c3aa79b0d267 (patch) | |
| tree | 7a652d752490109669b6915f83d826d6a34d7e9d /unittests/linuxliketests.py | |
| parent | 475bfba79a1a65d85e880a44fd995fc4aaf0c8c4 (diff) | |
| download | meson-fc9fd42899e1e2160a69ec245931c3aa79b0d267.tar.gz | |
interpreter: do not use pathlib for DependencyVariableString creation
Path.is_dir() can raise a PermissionError if a parent does not have
the executable permission set; plus the "in p.parents" tests are
very expensive. Do not use Path at all.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'unittests/linuxliketests.py')
| -rw-r--r-- | unittests/linuxliketests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index db7068d5b..6b896d73f 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -1862,6 +1862,18 @@ class LinuxlikeTests(BasePlatformTests): testdir = os.path.join(self.unit_test_dir, '125 pkgsubproj') self.init(testdir) + def test_unreadable_dir_in_declare_dep(self): + testdir = os.path.join(self.unit_test_dir, '125 declare_dep var') + tmpdir = Path(tempfile.mkdtemp()) + self.addCleanup(windows_proof_rmtree, tmpdir) + declaredepdir = tmpdir / 'test' + declaredepdir.mkdir() + try: + tmpdir.chmod(0o444) + self.init(testdir, extra_args=f'-Ddir={declaredepdir}') + finally: + tmpdir.chmod(0o755) + def check_has_flag(self, compdb, src, argument): for i in compdb: if src in i['file']: |
