summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-12-07 13:48:08 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2018-12-07 13:48:08 (GMT)
commit6652dd7ad52190441e6c4fd450ea91cb81a7123b (patch)
tree61b44de1bb7428c09071193f3e0437cc84f5c3d3
parentfdcbd705b3765379acdd46fb778b205165670ba2 (diff)
downloadSCons-6652dd7ad52190441e6c4fd450ea91cb81a7123b.zip
SCons-6652dd7ad52190441e6c4fd450ea91cb81a7123b.tar.gz
SCons-6652dd7ad52190441e6c4fd450ea91cb81a7123b.tar.bz2
Allow test to function minus otool verification on non mac platforms
-rw-r--r--test/LINK/applelink.py78
1 files changed, 41 insertions, 37 deletions
diff --git a/test/LINK/applelink.py b/test/LINK/applelink.py
index 6672234..da45a04 100644
--- a/test/LINK/applelink.py
+++ b/test/LINK/applelink.py
@@ -32,7 +32,7 @@ _python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
-# test.verbose_set(1)
+#test.verbose_set(1)
# Test issue # 2580
test.dir_fixture('applelink_image')
@@ -41,47 +41,51 @@ test.run(arguments='-f SConstruct_gh2580 -Q -n', stdout='gcc -o foo.o -c -Fframe
# Now test combinations of SHLIBVERSION, APPLELINK_CURRENT_VERSION, APPLELINK_COMPATIBILITY_VERSION
if sys.platform == 'darwin':
- for SHLIBVERSION, APPLELINK_CURRENT_VERSION, APPLELINK_COMPATIBILITY_VERSION, should_error in [
- ('1.2.3', '', '', False),
- ('1.2.3', '9.9.9', '9.9.0', False),
- ('99999.2.3', '', '', 'AppleLinkInvalidCurrentVersionException'),
- ('1.2.3', '9.9.999', '9.9.0', 'AppleLinkInvalidCurrentVersionException'),
- ('1.2.3', '9.9.9', '9.999.0', 'AppleLinkInvalidCompatibilityVersionException'),
- ('1.2.3', '9.9.9', '99999.99.0', 'AppleLinkInvalidCompatibilityVersionException'),
- ]:
- if not APPLELINK_CURRENT_VERSION:
- APPLELINK_CURRENT_VERSION = SHLIBVERSION
- if not APPLELINK_COMPATIBILITY_VERSION:
- APPLELINK_COMPATIBILITY_VERSION = '.'.join(APPLELINK_CURRENT_VERSION.split('.', 2)[:2] + ['0'])
+ extra_flags=''
+else:
+ extra_flags=' -n '
- if not should_error:
- expected_stdout = r"^.+ -dynamiclib -Wl,-current_version,{APPLELINK_CURRENT_VERSION} -Wl,-compatibility_version,{APPLELINK_COMPATIBILITY_VERSION}.+".format(
- **locals())
- expected_stderr = None
- expected_status = 0
- else:
- expected_stdout = None
- expected_stderr = r"^.+{should_error}.+".format(**locals())
- expected_status = 2
+for SHLIBVERSION, APPLELINK_CURRENT_VERSION, APPLELINK_COMPATIBILITY_VERSION, should_error in [
+ ('1.2.3', '', '', False),
+ ('1.2.3', '9.9.9', '9.9.0', False),
+ ('99999.2.3', '', '', 'AppleLinkInvalidCurrentVersionException'),
+ ('1.2.3', '9.9.999', '9.9.0', 'AppleLinkInvalidCurrentVersionException'),
+ ('1.2.3', '9.9.9', '9.999.0', 'AppleLinkInvalidCompatibilityVersionException'),
+ ('1.2.3', '9.9.9', '99999.99.0', 'AppleLinkInvalidCompatibilityVersionException'),
+]:
+ if not APPLELINK_CURRENT_VERSION:
+ APPLELINK_CURRENT_VERSION = SHLIBVERSION
+ if not APPLELINK_COMPATIBILITY_VERSION:
+ APPLELINK_COMPATIBILITY_VERSION = '.'.join(APPLELINK_CURRENT_VERSION.split('.', 2)[:2] + ['0'])
- test.run(
- arguments='-f SConstruct_CurVers_CompatVers SHLIBVERSION={SHLIBVERSION} APPLELINK_CURRENT_VERSION={APPLELINK_CURRENT_VERSION} APPLELINK_COMPATIBILITY_VERSION={APPLELINK_COMPATIBILITY_VERSION}'.format(**locals()),
- stdout=expected_stdout,
- stderr=expected_stderr,
- match=TestSCons.match_re_dotall,
- status=expected_status)
+ if not should_error:
+ expected_stdout = r"^.+ -dynamiclib -Wl,-current_version,{APPLELINK_CURRENT_VERSION} -Wl,-compatibility_version,{APPLELINK_COMPATIBILITY_VERSION}.+".format(
+ **locals())
+ expected_stderr = None
+ expected_status = 0
+ else:
+ expected_stdout = None
+ expected_stderr = r"^.+{should_error}.+".format(**locals())
+ expected_status = 2
- if not should_error:
- # Now run otool -L to get the compat and current version info and verify it's correct in the library.
- # 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)
- 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())
+ test.run(
+ arguments='{extra_flags} -f SConstruct_CurVers_CompatVers SHLIBVERSION={SHLIBVERSION} APPLELINK_CURRENT_VERSION={APPLELINK_CURRENT_VERSION} APPLELINK_COMPATIBILITY_VERSION={APPLELINK_COMPATIBILITY_VERSION}'.format(**locals()),
+ stdout=expected_stdout,
+ stderr=expected_stderr,
+ match=TestSCons.match_re_dotall,
+ status=expected_status)
- test.run(program='/usr/bin/otool', arguments='-L libfoo.%s.dylib' % SHLIBVERSION, stdout=otool_output)
+ if not (should_error or extra_flags):
+ # Now run otool -L to get the compat and current version info and verify it's correct in the library.
+ # 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)
+ 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())
+ test.run(program='/usr/bin/otool', arguments='-L libfoo.%s.dylib' % SHLIBVERSION, stdout=otool_output)
+
test.pass_test()
# Local Variables: