summaryrefslogtreecommitdiffstats
path: root/test/D/Issues
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2017-06-06 14:53:01 (GMT)
committerRussel Winder <russel@winder.org.uk>2017-06-06 14:53:01 (GMT)
commitbd8074e30b1fdd8837e6958609c76a919569c65c (patch)
tree9637ba8e406a0235043a11a096c21dc0bc8be6c4 /test/D/Issues
parent67cc5d57be7f835359742bacf062bcaf46e24efc (diff)
downloadSCons-bd8074e30b1fdd8837e6958609c76a919569c65c.zip
SCons-bd8074e30b1fdd8837e6958609c76a919569c65c.tar.gz
SCons-bd8074e30b1fdd8837e6958609c76a919569c65c.tar.bz2
Rearrange the test so it works properly.
Diffstat (limited to 'test/D/Issues')
-rw-r--r--test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py62
-rw-r--r--test/D/Issues/2994/Common/__init__.py0
-rw-r--r--test/D/Issues/2994/Common/sconstest.skip0
-rw-r--r--test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py23
-rw-r--r--test/D/Issues/2994/Project/SConstruct_template (renamed from test/D/Issues/2994/image/SConstruct)2
-rw-r--r--test/D/Issues/2994/Project/main.d (renamed from test/D/Issues/2994/image/main.d)0
6 files changed, 63 insertions, 24 deletions
diff --git a/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py
new file mode 100644
index 0000000..7e69f50
--- /dev/null
+++ b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py
@@ -0,0 +1,62 @@
+"""
+Test to check for issue reported in tigris bug 2994
+http://scons.tigris.org/issues/show_bug.cgi?id=2994
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestSCons
+
+from os.path import abspath, dirname, join
+
+import sys
+sys.path.insert(1, abspath(dirname(__file__) + '/../../../Support'))
+
+from executablesSearch import isExecutableOfToolAvailable
+
+
+def testForTool(tool):
+
+ test = TestSCons.TestSCons()
+
+ if not isExecutableOfToolAvailable(test, tool) :
+ test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool))
+
+ test.dir_fixture('Project')
+ test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{0}", "link"]'.format(tool)))
+
+ test.run()
+ test.fail_test('main.o' not in test.stdout())
+ test.run(arguments='change=1')
+ test.fail_test('is up to date' in test.stdout())
+
+ test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/D/Issues/2994/Common/__init__.py b/test/D/Issues/2994/Common/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/D/Issues/2994/Common/__init__.py
diff --git a/test/D/Issues/2994/Common/sconstest.skip b/test/D/Issues/2994/Common/sconstest.skip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/D/Issues/2994/Common/sconstest.skip
diff --git a/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py
deleted file mode 100644
index 1d9854f..0000000
--- a/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Test to check for issue reported in tigris bug 2994
-# http://scons.tigris.org/issues/show_bug.cgi?id=2994
-#
-
-import TestSCons
-
-test = TestSCons.TestSCons()
-
-dmd_present = test.detect_tool('dmd', prog='dmd')
-ldc_present = test.detect_tool('ldc',prog='ldc2')
-gdc_present = test.detect_tool('gdc',prog='gdc')
-
-if not (dmd_present or ldc_present or gdc_present):
- test.skip_test("Could not load dmd ldc or gdc Tool; skipping test(s).\n")
-
-
-test.dir_fixture('image')
-test.run()
-test.fail_test('main.o' not in test.stdout())
-test.run(arguments='change=1')
-test.fail_test('is up to date' in test.stdout())
-
-test.pass_test()
diff --git a/test/D/Issues/2994/image/SConstruct b/test/D/Issues/2994/Project/SConstruct_template
index 92f76c2..555b1b0 100644
--- a/test/D/Issues/2994/image/SConstruct
+++ b/test/D/Issues/2994/Project/SConstruct_template
@@ -1,6 +1,6 @@
# -*- mode:python; coding:utf-8; -*-
-env=Environment()
+env=Environment({})
change = ARGUMENTS.get('change', 0)
if int(change):
diff --git a/test/D/Issues/2994/image/main.d b/test/D/Issues/2994/Project/main.d
index f0aa23a..f0aa23a 100644
--- a/test/D/Issues/2994/image/main.d
+++ b/test/D/Issues/2994/Project/main.d