summaryrefslogtreecommitdiff
path: root/test/D
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2014-09-06 16:25:28 +0100
committerRussel Winder <russel@winder.org.uk>2014-09-06 16:25:28 +0100
commit5ea32b431e4184f7662cd90592bf59fbb7b96bed (patch)
tree6aa16a6e3f77e01d22fe3af6474d4192d2f8ba77 /test/D
parentd82d4dad709020c8acb2760c6a238cf6874903a9 (diff)
downloadscons-5ea32b431e4184f7662cd90592bf59fbb7b96bed.tar.gz
Deal better with the discovery of a suitable D compiler executable.
Diffstat (limited to 'test/D')
-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 4b1c1255..2d9333a6 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 3634d886..fc5f79f7 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 27b21d0a..11c061d5 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 3b178b94..d44c9bd2 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 3b178b94..d44c9bd2 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 48af057f..b005adfe 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'])