summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2014-09-06 15:25:28 (GMT)
committerRussel Winder <russel@winder.org.uk>2014-09-06 15:25:28 (GMT)
commit70a6365e0bcf530819a83edaa3b9d9bbc08b218e (patch)
tree6aa16a6e3f77e01d22fe3af6474d4192d2f8ba77 /test
parent414cb583cf31b2a8c65704e57dd19cfb865e6582 (diff)
downloadSCons-70a6365e0bcf530819a83edaa3b9d9bbc08b218e.zip
SCons-70a6365e0bcf530819a83edaa3b9d9bbc08b218e.tar.gz
SCons-70a6365e0bcf530819a83edaa3b9d9bbc08b218e.tar.bz2
Deal better with the discovery of a suitable D compiler executable.
Diffstat (limited to 'test')
-rw-r--r--test/D/DMD.py8
-rw-r--r--test/D/DMD2.py9
-rw-r--r--test/D/DMD2_Alt.py9
-rw-r--r--test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py16
-rw-r--r--test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py16
-rw-r--r--test/D/Scanner.py8
6 files changed, 56 insertions, 10 deletions
diff --git a/test/D/DMD.py b/test/D/DMD.py
index 4b1c125..2d9333a 100644
--- a/test/D/DMD.py
+++ b/test/D/DMD.py
@@ -28,11 +28,15 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
+import sys
+from os.path import abspath, dirname, join
+sys.path.append(join(dirname(abspath(__file__)), 'Support'))
+from executablesSearch import isExecutableOfToolAvailable
+
_exe = TestSCons._exe
test = TestSCons.TestSCons()
-dmd = test.where_is('dmd')
-if not dmd:
+if not isExecutableOfToolAvailable(test, 'dmd'):
test.skip_test("Could not find 'dmd'; skipping test.\n")
test.write('SConstruct', """\
diff --git a/test/D/DMD2.py b/test/D/DMD2.py
index 3634d88..fc5f79f 100644
--- a/test/D/DMD2.py
+++ b/test/D/DMD2.py
@@ -28,11 +28,16 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
+import sys
+from os.path import abspath, dirname, join
+sys.path.append(join(dirname(abspath(__file__)), 'Support'))
+from executablesSearch import isExecutableOfToolAvailable
+
_exe = TestSCons._exe
test = TestSCons.TestSCons()
-if not test.where_is('dmd') and not test.where_is('gdmd'):
- test.skip_test("Could not find 'dmd' or 'gdmd', skipping test.\n")
+if not isExecutableOfToolAvailable(test, 'dmd'):
+ test.skip_test("Could not find 'dmd'; skipping test.\n")
test.write('SConstruct', """\
import os
diff --git a/test/D/DMD2_Alt.py b/test/D/DMD2_Alt.py
index 27b21d0..11c061d 100644
--- a/test/D/DMD2_Alt.py
+++ b/test/D/DMD2_Alt.py
@@ -28,11 +28,16 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
+import sys
+from os.path import abspath, dirname, join
+sys.path.append(join(dirname(abspath(__file__)), 'Support'))
+from executablesSearch import isExecutableOfToolAvailable
+
_exe = TestSCons._exe
test = TestSCons.TestSCons()
-if not test.where_is('dmd') and not test.where_is('gdmd'):
- test.skip_test("Could not find 'dmd' or 'gdmd', skipping test.\n")
+if not isExecutableOfToolAvailable(test, 'dmd'):
+ test.skip_test("Could not find 'dmd'; skipping test.\n")
test.write('SConstruct', """\
import os
diff --git a/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py b/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py
index 3b178b9..d44c9bd 100644
--- a/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py
+++ b/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py
@@ -50,7 +50,21 @@ def testForTool(tool):
test.run()
- for f in ('libstuff.so', 'stuff.os', 'test1', 'test1.o', 'test2', 'test2.o'):
+ platform = Base()['PLATFORM']
+
+ if platform == 'posix':
+ libraryname = 'libstuff.so'
+ filename = 'stuff.os'
+ elif platform == 'darwin':
+ libraryname = 'libstuff.dylib'
+ filename = 'stuff.os'
+ elif platform == 'win32':
+ libraryname = 'stuff.dll'
+ filename = 'stuff.obj'
+ else:
+ test.fail_test('No information about platform: ' + platform)
+
+ for f in (libraryname, filename, 'test1', 'test1.o', 'test2', 'test2.o'):
test.must_exist(test.workpath(join('test', 'test1', f)))
test.pass_test()
diff --git a/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py
index 3b178b9..d44c9bd 100644
--- a/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py
+++ b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py
@@ -50,7 +50,21 @@ def testForTool(tool):
test.run()
- for f in ('libstuff.so', 'stuff.os', 'test1', 'test1.o', 'test2', 'test2.o'):
+ platform = Base()['PLATFORM']
+
+ if platform == 'posix':
+ libraryname = 'libstuff.so'
+ filename = 'stuff.os'
+ elif platform == 'darwin':
+ libraryname = 'libstuff.dylib'
+ filename = 'stuff.os'
+ elif platform == 'win32':
+ libraryname = 'stuff.dll'
+ filename = 'stuff.obj'
+ else:
+ test.fail_test('No information about platform: ' + platform)
+
+ for f in (libraryname, filename, 'test1', 'test1.o', 'test2', 'test2.o'):
test.must_exist(test.workpath(join('test', 'test1', f)))
test.pass_test()
diff --git a/test/D/Scanner.py b/test/D/Scanner.py
index 48af057..b005adf 100644
--- a/test/D/Scanner.py
+++ b/test/D/Scanner.py
@@ -31,12 +31,16 @@ a single statement.
import TestSCons
+import sys
+from os.path import abspath, dirname, join
+sys.path.append(join(dirname(abspath(__file__)), 'Support'))
+from executablesSearch import isExecutableOfToolAvailable
+
test = TestSCons.TestSCons()
_obj = TestSCons._obj
-dmd = test.where_is('dmd')
-if not dmd:
+if not isExecutableOfToolAvailable(test, 'dmd'):
test.skip_test("Could not find 'dmd'; skipping test.\n")
test.subdir(['p'])