summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2017-06-21 15:40:40 (GMT)
committerRussel Winder <russel@winder.org.uk>2017-06-21 15:40:40 (GMT)
commit1f1871896e0de86e40135bedf519374d65bbde2e (patch)
tree804eebc3db16a77fd3979aa475499350b125033c /test
parentb726447e54cad80cfff3422f52f6afcd5798e59f (diff)
downloadSCons-1f1871896e0de86e40135bedf519374d65bbde2e.zip
SCons-1f1871896e0de86e40135bedf519374d65bbde2e.tar.gz
SCons-1f1871896e0de86e40135bedf519374d65bbde2e.tar.bz2
Be more careful about the shared library names.
Diffstat (limited to 'test')
-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 d850c98..d6337ba 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 a0a112a..5e4d36f 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()