summaryrefslogtreecommitdiff
path: root/unittests/internaltests.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2023-09-01 17:23:29 -0400
committerEli Schwartz <eschwartz93@gmail.com>2023-09-26 02:36:15 -0400
commit5b317c5658f5865aea76b5a5afda2cdc8bd50959 (patch)
tree9bb31e094a59d2c64faf94d8b2fcc07c5a55811d /unittests/internaltests.py
parentfb6fd5aa1770970e94968b302dfe3026aa08e245 (diff)
downloadmeson-5b317c5658f5865aea76b5a5afda2cdc8bd50959.tar.gz
compilers: use correct version comparison for openbsd libraries
It should *be* a version comparison. We are guaranteed to get a two-element version number, which also parses as a float but a float doesn't correctly handle version sorting when the second component differs in number of digits. The standard way to handle this is by comparing tuples such that each component is an integer. Do so here. Fixes #12195 Co-authored-by: George Koehler <xkernigh@netscape.net> (for unittests)
Diffstat (limited to 'unittests/internaltests.py')
-rw-r--r--unittests/internaltests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index 56d36117a..eb3b1717a 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -549,11 +549,14 @@ class InternalTests(unittest.TestCase):
if platform != 'openbsd':
return
with tempfile.TemporaryDirectory() as tmpdir:
- for i in ['libfoo.so.6.0', 'libfoo.so.5.0', 'libfoo.so.54.0', 'libfoo.so.66a.0b', 'libfoo.so.70.0.so.1']:
+ for i in ['libfoo.so.6.0', 'libfoo.so.5.0', 'libfoo.so.54.0', 'libfoo.so.66a.0b', 'libfoo.so.70.0.so.1',
+ 'libbar.so.7.10', 'libbar.so.7.9', 'libbar.so.7.9.3']:
libpath = Path(tmpdir) / i
libpath.write_text('', encoding='utf-8')
found = cc._find_library_real('foo', env, [tmpdir], '', LibType.PREFER_SHARED, lib_prefix_warning=True)
self.assertEqual(os.path.basename(found[0]), 'libfoo.so.54.0')
+ found = cc._find_library_real('bar', env, [tmpdir], '', LibType.PREFER_SHARED, lib_prefix_warning=True)
+ self.assertEqual(os.path.basename(found[0]), 'libbar.so.7.10')
def test_find_library_patterns(self):
'''