Skip to content

Commit 9e873c2

Browse files
authored
TST: Clarify RPATH testing asserts.
Still need to get the test compiling in the alternate location. Did I add -L/tmp?
1 parent 3fb6828 commit 9e873c2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

distutils/tests/test_build_ext.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,20 @@ def _test_xx(copy_so):
165165
so_headers = subprocess.check_output(
166166
["readelf", "-d", xx.__file__], universal_newlines=True
167167
)
168+
import pprint
169+
pprint.pprint(so_headers)
170+
rpaths = [
171+
rpath
172+
for line in so_headers.split("\n") if "RPATH" in line or "RUNPATH" in line
173+
for rpath in line.split()[2][1:-1].split(":")
174+
]
168175
if not copy_so:
169-
import pprint
170-
pprint.pprint(so_headers)
176+
pprint.pprint(rpaths)
171177
# Linked against a library in /usr/lib{,64}
172-
assert 'RPATH' not in so_headers and 'RUNPATH' not in so_headers
178+
assert "/usr/lib" not in rpaths and "/usr/lib64" not in rpaths
173179
else:
174180
# Linked against a library in /tmp
175-
assert 'RPATH' in so_headers or 'RUNPATH' in so_headers
181+
assert "/tmp" in rpaths
176182
# The import is the real test here
177183

178184
def test_solaris_enable_shared(self):

0 commit comments

Comments
 (0)