summaryrefslogtreecommitdiff
path: root/test/D
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2014-09-14 17:27:51 +0100
committerRussel Winder <russel@winder.org.uk>2014-09-14 17:27:51 +0100
commit0a6fc55a9777c107b4638024dea5f94b2bed462c (patch)
treebd0759c497b84500377ecc5a4035d9c62b2915ca /test/D
parente27eb6483266aa5f4347af8224f3fd0c509c4b32 (diff)
downloadscons-0a6fc55a9777c107b4638024dea5f94b2bed462c.tar.gz
Refactoring and amendment to ensure correct behaviour of D tool shared library tests on OSX.
Diffstat (limited to 'test/D')
-rw-r--r--test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py14
-rw-r--r--test/D/SharedObjects/Common/common.py26
-rw-r--r--test/D/SharedObjects/sconstest-gdc.py3
3 files changed, 25 insertions, 18 deletions
diff --git a/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py
index d44c9bd2..0aaa2832 100644
--- a/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py
+++ b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py
@@ -45,25 +45,27 @@ def testForTool(tool):
if not isExecutableOfToolAvailable(test, tool) :
test.skip_test("Required executable for tool '{}' not found, skipping test.\n".format(tool))
- test.dir_fixture('Project')
- test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{}", "link"]'.format(tool)))
-
- test.run()
-
platform = Base()['PLATFORM']
-
if platform == 'posix':
libraryname = 'libstuff.so'
filename = 'stuff.os'
elif platform == 'darwin':
libraryname = 'libstuff.dylib'
filename = 'stuff.os'
+ # As at 2014-09-14, DMD 2.066, LDC master head, and GDC 4.9.1 do not support
+ # shared libraries on OSX.
+ test.skip_test('Dynamic libraries not yet supported on OSX.\n')
elif platform == 'win32':
libraryname = 'stuff.dll'
filename = 'stuff.obj'
else:
test.fail_test('No information about platform: ' + platform)
+ test.dir_fixture('Project')
+ test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{}", "link"]'.format(tool)))
+
+ test.run()
+
for f in (libraryname, filename, 'test1', 'test1.o', 'test2', 'test2.o'):
test.must_exist(test.workpath(join('test', 'test1', f)))
diff --git a/test/D/SharedObjects/Common/common.py b/test/D/SharedObjects/Common/common.py
index a5d7b275..e608fdb5 100644
--- a/test/D/SharedObjects/Common/common.py
+++ b/test/D/SharedObjects/Common/common.py
@@ -45,15 +45,10 @@ def testForTool(tool):
if not isExecutableOfToolAvailable(test, tool) :
test.skip_test("Required executable for tool '{}' not found, skipping test.\n".format(tool))
- test.dir_fixture('Image')
- test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool))
- if tool == 'dmd':
- # The gdmd executable in Debian Unstable as at 2012-05-12, version 4.6.3 puts out messages on stderr
- # that cause inappropriate failure of the tests, so simply ignore them.
- test.run(stderr=None)
- else:
- test.run()
+ if tool == 'gdc':
+ test.skip_test('gdc does not, as at version 4.9.1, support shared libraries.\n')
+
platform = Base()['PLATFORM']
if platform == 'posix':
@@ -62,12 +57,25 @@ def testForTool(tool):
elif platform == 'darwin':
filename = 'code.o'
libraryname = 'libanswer.dylib'
- elif platform == 'win32' or platform == 'win64':
+ # As at 2014-09-14, DMD 2.066, LDC master head, and GDC 4.9.1 do not support
+ # shared libraries on OSX.
+ test.skip_test('Dynamic libraries not yet supported on OSX.\n')
+ elif platform == 'win32':
filename = 'code.obj'
libraryname = 'answer.dll'
else:
test.fail_test()
+ test.dir_fixture('Image')
+ test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool))
+
+ if tool == 'dmd':
+ # The gdmd executable in Debian Unstable as at 2012-05-12, version 4.6.3 puts out messages on stderr
+ # that cause inappropriate failure of the tests, so simply ignore them.
+ test.run(stderr=None)
+ else:
+ test.run()
+
test.must_exist(test.workpath(filename))
test.must_exist(test.workpath(libraryname))
diff --git a/test/D/SharedObjects/sconstest-gdc.py b/test/D/SharedObjects/sconstest-gdc.py
index 7d0f28c1..43bb8ebd 100644
--- a/test/D/SharedObjects/sconstest-gdc.py
+++ b/test/D/SharedObjects/sconstest-gdc.py
@@ -27,9 +27,6 @@ Test compiling and executing using the gcd tool.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import TestSCons
-TestSCons.TestSCons().skip_test('SKIPPED... gdc does not, as at version 4.9.1, support shared libraries.\n')
-
from Common.common import testForTool
testForTool('gdc')