diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-12-11 17:26:39 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2019-12-11 17:26:39 (GMT) |
commit | 93507d5535e68341ca93af7efbc05fe6af1025e6 (patch) | |
tree | d8b6199ad6698100c32c84bfcea738561cc17d11 /test | |
parent | c09ac3c715cb18dc419d12c5bf90adb3019bede0 (diff) | |
download | SCons-93507d5535e68341ca93af7efbc05fe6af1025e6.zip SCons-93507d5535e68341ca93af7efbc05fe6af1025e6.tar.gz SCons-93507d5535e68341ca93af7efbc05fe6af1025e6.tar.bz2 |
Fix looking for specific version of libSystem.B.dylib when running on macOS. Use regex of #.#.# instead
Diffstat (limited to 'test')
-rw-r--r-- | test/LINK/applelink.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/LINK/applelink.py b/test/LINK/applelink.py index 86e0a4c..e1b2837 100644 --- a/test/LINK/applelink.py +++ b/test/LINK/applelink.py @@ -25,6 +25,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import sys +import re import TestSCons @@ -83,10 +84,14 @@ for SHLIBVERSION, APPLELINK_CURRENT_VERSION, APPLELINK_COMPATIBILITY_VERSION, sh # libfoo.1.2.3.dylib: # > libfoo.1.2.3.dylib (compatibility version 1.1.99, current version 9.9.9) # > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) - otool_output = "libfoo.{SHLIBVERSION}.dylib:\n\tlibfoo.{SHLIBVERSION}.dylib (compatibility version {APPLELINK_COMPATIBILITY_VERSION}, current version {APPLELINK_CURRENT_VERSION})\n\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)\n".format( - **locals()) + # otool_output = "libfoo.{SHLIBVERSION}.dylib:\n\tlibfoo.{SHLIBVERSION}.dylib (compatibility version {APPLELINK_COMPATIBILITY_VERSION}, current version {APPLELINK_CURRENT_VERSION})\n\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)\n".format( + # **locals()) + otool_output = "libfoo.{SHLIBVERSION}.dylib:\n\tlibfoo.{SHLIBVERSION}.dylib (compatibility version {APPLELINK_COMPATIBILITY_VERSION}, current version {APPLELINK_CURRENT_VERSION})\n\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version REPLACEME)\n".format(**locals()) + otool_output = re.escape(otool_output) + otool_output = otool_output.replace('REPLACEME','\d+\.\d+\.\d+') + - test.run(program='/usr/bin/otool', arguments='-L libfoo.%s.dylib' % SHLIBVERSION, stdout=otool_output) + test.run(program='/usr/bin/otool', arguments='-L libfoo.%s.dylib' % SHLIBVERSION, stdout=otool_output, match=TestSCons.match_re_dotall) # Now test that None in APPLELINK_CURRENT_VERSION or APPLELINK_COMPATIBILITY_VERSION will skip # generating their relevant linker command line flag. @@ -135,15 +140,16 @@ for SHLIBVERSION, \ # We expect output such as this # libfoo.1.2.3.dylib: # > libfoo.1.2.3.dylib (compatibility version 1.1.99, current version 9.9.9) - # > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) + # > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version #.#.#) if APPLELINK_NO_CURRENT_VERSION: APPLELINK_CURRENT_VERSION = '0.0.0' if APPLELINK_NO_COMPATIBILITY_VERSION: APPLELINK_COMPATIBILITY_VERSION = '0.0.0' - otool_output = "libfoo.{SHLIBVERSION}.dylib:\n\tlibfoo.{SHLIBVERSION}.dylib (compatibility version {APPLELINK_COMPATIBILITY_VERSION}, current version {APPLELINK_CURRENT_VERSION})\n\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)\n".format( + otool_output = "libfoo.{SHLIBVERSION}.dylib:\n\tlibfoo.{SHLIBVERSION}.dylib (compatibility version {APPLELINK_COMPATIBILITY_VERSION}, current version {APPLELINK_CURRENT_VERSION})\n\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version REPLACEME)\n".format( **locals()) + otool_output = re.escape(otool_output).replace('REPLACEME','\d+\.\d+\.\d+') - test.run(program='/usr/bin/otool', arguments='-L libfoo.%s.dylib' % SHLIBVERSION, stdout=otool_output) + test.run(program='/usr/bin/otool', arguments='-L libfoo.%s.dylib' % SHLIBVERSION, stdout=otool_output, match=TestSCons.match_re_dotall) test.pass_test() |