summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2020-12-21 02:21:45 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2020-12-21 02:21:45 (GMT)
commit5e6fe1a165f2e9a8c9db23a8ea958704200e95de (patch)
treede31661b88fb05659b9ea5526a44961fd28e06a9 /test
parent78292be9cbb471101e6ed4ec5f6da0161730c656 (diff)
downloadSCons-5e6fe1a165f2e9a8c9db23a8ea958704200e95de.zip
SCons-5e6fe1a165f2e9a8c9db23a8ea958704200e95de.tar.gz
SCons-5e6fe1a165f2e9a8c9db23a8ea958704200e95de.tar.bz2
initial checkin of versioned shared library rewrite
Diffstat (limited to 'test')
-rw-r--r--test/LINK/SHLIBVERSIONFLAGS.py35
1 files changed, 17 insertions, 18 deletions
diff --git a/test/LINK/SHLIBVERSIONFLAGS.py b/test/LINK/SHLIBVERSIONFLAGS.py
index 7bcabf0..7832862 100644
--- a/test/LINK/SHLIBVERSIONFLAGS.py
+++ b/test/LINK/SHLIBVERSIONFLAGS.py
@@ -25,10 +25,10 @@
#
-
import TestSCons
-import SCons.Platform
+
import SCons.Defaults
+import SCons.Platform
foo_c_src = "void foo() {}\n"
@@ -39,34 +39,33 @@ tool_list = SCons.Platform.DefaultToolList(platform, env)
test = TestSCons.TestSCons()
if 'gnulink' in tool_list:
versionflags = r".+ -Wl,-soname=libfoo.so.1( .+)+"
- soname='libfoo.so.4'
- sonameVersionFlags=r".+ -Wl,-soname=%s( .+)+" % soname
+ soname = 'libfoo.so.4'
+ sonameVersionFlags = r".+ -Wl,-soname=%s( .+)+" % soname
elif 'sunlink' in tool_list:
versionflags = r".+ -h libfoo.so.1( .+)+"
- soname='libfoo.so.4'
- sonameVersionFlags=r".+ -h %s( .+)+" % soname
+ soname = 'libfoo.so.4'
+ sonameVersionFlags = r".+ -h %s( .+)+" % soname
elif 'applelink' in tool_list:
- versionflags = r".+ 'libfoo.1.dylib'->'libfoo.1.2.3.dylib'(.+)+"
- soname='libfoo.4.dylib'
- sonameVersionFlags=r".+ '%s'->'libfoo.1.2.3.dylib'(.+)+" % soname
+ versionflags = r" 'libfoo.1.dylib'->'libfoo.1.2.3.dylib'"
+ soname = 'libfoo.4.dylib'
+ sonameVersionFlags = r" '%s'->'libfoo.1.2.3.dylib'(.+)+" % soname
else:
test.skip_test('No testable linkers found, skipping the test\n')
-
# stdout must not contain SHLIBVERSIONFLAGS if there is no SHLIBVERSION provided
test.write('foo.c', foo_c_src)
test.write('SConstruct', "SharedLibrary('foo','foo.c')\n")
test.run()
test.fail_test(test.match_re_dotall(test.stdout(), versionflags))
-test.run(arguments = ['-c'])
+test.run(arguments=['-c'])
# stdout must contain SHLIBVERSIONFLAGS if there is SHLIBVERSION provided
test = TestSCons.TestSCons()
test.write('foo.c', foo_c_src)
test.write('SConstruct', "SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3')\n")
-test.run(stdout = versionflags, match = TestSCons.match_re_dotall)
-test.run(arguments = ['-c'])
+test.run(stdout=versionflags, match=TestSCons.match_re_dotall)
+test.run(arguments=['-c'])
# stdout must contain SONAME if there is SONAME provided
test = TestSCons.TestSCons()
@@ -74,9 +73,9 @@ test.write('foo.c', foo_c_src)
test.write('SConstruct', """
SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3',SONAME='%s')
""" % soname)
-test.run(stdout = sonameVersionFlags, match = TestSCons.match_re_dotall)
+test.run(stdout=sonameVersionFlags, match=TestSCons.match_re_dotall)
test.must_exist(test.workpath(soname))
-test.run(arguments = ['-c'])
+test.run(arguments=['-c'])
# stdout must contain SOVERSION if there is SOVERSION provided
test = TestSCons.TestSCons()
@@ -84,9 +83,9 @@ test.write('foo.c', foo_c_src)
test.write('SConstruct', """
SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3',SOVERSION='4')
""")
-test.run(stdout = sonameVersionFlags, match = TestSCons.match_re_dotall)
+test.run(stdout=sonameVersionFlags, match=TestSCons.match_re_dotall)
test.must_exist(test.workpath(soname))
-test.run(arguments = ['-c'])
+test.run(arguments=['-c'])
# test if both SONAME and SOVERSION are used
test = TestSCons.TestSCons()
@@ -94,7 +93,7 @@ test.write('foo.c', foo_c_src)
test.write('SConstruct', """
SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3',SONAME='%s',SOVERSION='4')
""" % soname)
-test.run(status=2,stderr=None)
+test.run(status=2, stderr=None)
test.must_contain_all_lines(test.stderr(), ['Ambiguous library .so naming'])
test.pass_test()