run_project_tests: support checking for symlinks

pull/12260/head
Arsen Arsenović 2 years ago committed by Eli Schwartz
parent ef5931f12d
commit 56ef698426
  1. 3
      data/test.schema.json
  2. 7
      run_project_tests.py

@ -33,7 +33,8 @@
"py_implib", "py_implib",
"py_limited_implib", "py_limited_implib",
"implibempty", "implibempty",
"expr" "expr",
"link"
] ]
}, },
"platform": { "platform": {

@ -199,7 +199,7 @@ class InstalledFile:
return None return None
if self.typ == 'python_bytecode': if self.typ == 'python_bytecode':
return p.parent / importlib.util.cache_from_source(p.name) return p.parent / importlib.util.cache_from_source(p.name)
elif self.typ in {'file', 'dir'}: elif self.typ in {'file', 'dir', 'link'}:
return p return p
elif self.typ == 'shared_lib': elif self.typ == 'shared_lib':
if env.machines.host.is_windows() or env.machines.host.is_cygwin(): if env.machines.host.is_windows() or env.machines.host.is_cygwin():
@ -263,6 +263,11 @@ class InstalledFile:
if not abs_p.is_dir(): if not abs_p.is_dir():
raise RuntimeError(f'{p} is not a directory') raise RuntimeError(f'{p} is not a directory')
return [x.relative_to(installdir) for x in abs_p.rglob('*') if x.is_file() or x.is_symlink()] return [x.relative_to(installdir) for x in abs_p.rglob('*') if x.is_file() or x.is_symlink()]
elif self.typ == 'link':
abs_p = installdir / p
if not abs_p.is_symlink():
raise RuntimeError(f'{p} is not a symlink')
return [p]
else: else:
return [p] return [p]

Loading…
Cancel
Save