summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2017-06-21 16:40:40 +0100
committerRussel Winder <russel@winder.org.uk>2017-06-21 16:40:40 +0100
commit60ca03d56385ed55a58f714ecc775c3c8c988af7 (patch)
tree804eebc3db16a77fd3979aa475499350b125033c
parent16a4f6b9b2737d72638e7252c47c17081b4e374b (diff)
downloadscons-60ca03d56385ed55a58f714ecc775c3c8c988af7.tar.gz
Be more careful about the shared library names.
-rw-r--r--test/Clang/clang++_shared_library.py18
-rw-r--r--test/Clang/clang_shared_library.py17
2 files changed, 33 insertions, 2 deletions
diff --git a/test/Clang/clang++_shared_library.py b/test/Clang/clang++_shared_library.py
index d850c980..d6337ba7 100644
--- a/test/Clang/clang++_shared_library.py
+++ b/test/Clang/clang++_shared_library.py
@@ -26,12 +26,27 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
+from SCons.Environment import Base
+
_exe = TestSCons._exe
test = TestSCons.TestSCons()
if not test.where_is('clang'):
test.skip_test("Could not find 'clang++', skipping test.\n")
+platform = Base()['PLATFORM']
+if platform == 'posix':
+ filename = 'foo.os'
+ libraryname = 'libfoo.so'
+elif platform == 'darwin':
+ filename = 'foo.os'
+ libraryname = 'libfoo.dylib'
+elif platform == 'win32':
+ filename = 'foo.obj'
+ libraryname = 'foo.dll'
+else:
+ test.fail_test()
+
test.write('SConstruct', """\
env = Environment(tools=['clang++', 'link'])
env.SharedLibrary('foo', 'foo.cpp')
@@ -45,7 +60,8 @@ int bar() {
test.run()
-test.must_exist(test.workpath('libfoo.so'))
+test.must_exist(test.workpath(filename))
+test.must_exist(test.workpath(libraryname))
test.pass_test()
diff --git a/test/Clang/clang_shared_library.py b/test/Clang/clang_shared_library.py
index a0a112ab..5e4d36f9 100644
--- a/test/Clang/clang_shared_library.py
+++ b/test/Clang/clang_shared_library.py
@@ -25,6 +25,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
+from SCons.Environment import Base
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -32,6 +33,19 @@ test = TestSCons.TestSCons()
if not test.where_is('clang'):
test.skip_test("Could not find 'clang', skipping test.\n")
+platform = Base()['PLATFORM']
+if platform == 'posix':
+ filename = 'foo.os'
+ libraryname = 'libfoo.so'
+elif platform == 'darwin':
+ filename = 'foo.os'
+ libraryname = 'libfoo.dylib'
+elif platform == 'win32':
+ filename = 'foo.obj'
+ libraryname = 'foo.dll'
+else:
+ test.fail_test()
+
test.write('SConstruct', """\
env = Environment(tools=['clang', 'link'])
env.SharedLibrary('foo', 'foo.c')
@@ -45,7 +59,8 @@ int bar() {
test.run()
-test.must_exist(test.workpath('libfoo.so'))
+test.must_exist(test.workpath(filename))
+test.must_exist(test.workpath(libraryname))
test.pass_test()