diff options
Diffstat (limited to 'test/D/Issues')
27 files changed, 555 insertions, 0 deletions
diff --git a/test/D/Issues/2939_Ariovistus/Common/__init__.py b/test/D/Issues/2939_Ariovistus/Common/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Common/__init__.py diff --git a/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py b/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py new file mode 100644 index 0000000..1b42580 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py @@ -0,0 +1,76 @@ +""" +These tests check a problem with the linker options setting. +""" + +# +# __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 SCons.Environment import Base + +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() + + 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() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2939_Ariovistus/Common/sconstest.skip b/test/D/Issues/2939_Ariovistus/Common/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Common/sconstest.skip diff --git a/test/D/Issues/2939_Ariovistus/Project/SConstruct_template b/test/D/Issues/2939_Ariovistus/Project/SConstruct_template new file mode 100644 index 0000000..c78ba96 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Project/SConstruct_template @@ -0,0 +1,12 @@ +from os.path import join + +environment = Environment({}) + +import os +environment['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd + +Export('environment') + +environment.SConscript([ + join("test","test1", "SConscript"), +]); diff --git a/test/D/Issues/2939_Ariovistus/Project/test/test1/SConscript b/test/D/Issues/2939_Ariovistus/Project/test/test1/SConscript new file mode 100644 index 0000000..53a1ca0 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Project/test/test1/SConscript @@ -0,0 +1,14 @@ +Import('environment') + +env = Environment() +env.SharedLibrary(target='stuff', source=['stuff.cpp']) + +env = Environment() +env.Append(LIBPATH=['.']) +env.Append(LIBS=['stuff']) +env.Program(target='test1', source=['test1.cpp']) + +env = environment.Clone() +env.Append(LIBPATH=['.']) +env.Append(LIBS=['stuff']) +env.Program(target='test2', source=['test2.d']) diff --git a/test/D/Issues/2939_Ariovistus/Project/test/test1/stuff.cpp b/test/D/Issues/2939_Ariovistus/Project/test/test1/stuff.cpp new file mode 100644 index 0000000..2970549 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Project/test/test1/stuff.cpp @@ -0,0 +1,12 @@ +#include "stuff.h" + +X::X() { + this->i = 1; +} +int X::y(){ + return this->i; +} + +X *SomeX() { + return new X(); +} diff --git a/test/D/Issues/2939_Ariovistus/Project/test/test1/stuff.h b/test/D/Issues/2939_Ariovistus/Project/test/test1/stuff.h new file mode 100644 index 0000000..863c330 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Project/test/test1/stuff.h @@ -0,0 +1,10 @@ + +class X { + public: + int i; + + X(); + int y(); +}; + +X *SomeX(); diff --git a/test/D/Issues/2939_Ariovistus/Project/test/test1/test1.cpp b/test/D/Issues/2939_Ariovistus/Project/test/test1/test1.cpp new file mode 100644 index 0000000..f4d7208 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Project/test/test1/test1.cpp @@ -0,0 +1,5 @@ +#include "stuff.h" + +int main() { + X *x = SomeX(); +} diff --git a/test/D/Issues/2939_Ariovistus/Project/test/test1/test2.d b/test/D/Issues/2939_Ariovistus/Project/test/test1/test2.d new file mode 100644 index 0000000..4fbfa4d --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/Project/test/test1/test2.d @@ -0,0 +1,13 @@ +import std.stdio; + +struct X { +} + +extern(C) int _ZN1X1yEv(X* _this); +extern(C) X* _Z5SomeXv(); + +void main() { + X *x = _Z5SomeXv(); + int i = _ZN1X1yEv(x); + writeln("i: ", i); +} diff --git a/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py new file mode 100644 index 0000000..2446a28 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py @@ -0,0 +1,37 @@ +""" +Test compiling and executing using the gdc tool. +""" + +# +# __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__" + +from Common.correctLinkOptions import testForTool +testForTool('dmd') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_gdc.py b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_gdc.py new file mode 100644 index 0000000..baf2921 --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_gdc.py @@ -0,0 +1,37 @@ +""" +Test compiling and executing using the gdc tool. +""" + +# +# __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__" + +from Common.correctLinkOptions import testForTool +testForTool('gdc') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py new file mode 100644 index 0000000..a61a94b --- /dev/null +++ b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py @@ -0,0 +1,37 @@ +""" +Test compiling and executing using the gdc tool. +""" + +# +# __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__" + +from Common.correctLinkOptions import testForTool +testForTool('ldc') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2940_Ariovistus/Common/__init__.py b/test/D/Issues/2940_Ariovistus/Common/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Common/__init__.py diff --git a/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py new file mode 100644 index 0000000..8060add --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py @@ -0,0 +1,78 @@ +""" +These tests check a problem with the linker options setting. +""" + +# +# __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 SCons.Environment import Base + +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)) + + 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=["{0}", "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))) + + 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/2940_Ariovistus/Common/sconstest.skip b/test/D/Issues/2940_Ariovistus/Common/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Common/sconstest.skip diff --git a/test/D/Issues/2940_Ariovistus/Project/SConstruct_template b/test/D/Issues/2940_Ariovistus/Project/SConstruct_template new file mode 100644 index 0000000..c78ba96 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Project/SConstruct_template @@ -0,0 +1,12 @@ +from os.path import join + +environment = Environment({}) + +import os +environment['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd + +Export('environment') + +environment.SConscript([ + join("test","test1", "SConscript"), +]); diff --git a/test/D/Issues/2940_Ariovistus/Project/test/test1/SConscript b/test/D/Issues/2940_Ariovistus/Project/test/test1/SConscript new file mode 100644 index 0000000..45e517a --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Project/test/test1/SConscript @@ -0,0 +1,16 @@ +Import('environment') + +env = Environment() +env.SharedLibrary(target='stuff', source=['stuff.cpp']) + +env = Environment() +env.Append(LIBPATH=['.']) +env.Append(LIBS=['stuff']) +env.Append(RPATH=['.']) +env.Program(target='test1', source=['test1.cpp']) + +env = environment.Clone() +env.Append(LIBPATH=['.']) +env.Append(LIBS=['stuff']) +env.Append(RPATH=['.']) +env.Program(target='test2', source=['test2.d']) diff --git a/test/D/Issues/2940_Ariovistus/Project/test/test1/stuff.cpp b/test/D/Issues/2940_Ariovistus/Project/test/test1/stuff.cpp new file mode 100644 index 0000000..2970549 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Project/test/test1/stuff.cpp @@ -0,0 +1,12 @@ +#include "stuff.h" + +X::X() { + this->i = 1; +} +int X::y(){ + return this->i; +} + +X *SomeX() { + return new X(); +} diff --git a/test/D/Issues/2940_Ariovistus/Project/test/test1/stuff.h b/test/D/Issues/2940_Ariovistus/Project/test/test1/stuff.h new file mode 100644 index 0000000..863c330 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Project/test/test1/stuff.h @@ -0,0 +1,10 @@ + +class X { + public: + int i; + + X(); + int y(); +}; + +X *SomeX(); diff --git a/test/D/Issues/2940_Ariovistus/Project/test/test1/test1.cpp b/test/D/Issues/2940_Ariovistus/Project/test/test1/test1.cpp new file mode 100644 index 0000000..f4d7208 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Project/test/test1/test1.cpp @@ -0,0 +1,5 @@ +#include "stuff.h" + +int main() { + X *x = SomeX(); +} diff --git a/test/D/Issues/2940_Ariovistus/Project/test/test1/test2.d b/test/D/Issues/2940_Ariovistus/Project/test/test1/test2.d new file mode 100644 index 0000000..4fbfa4d --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/Project/test/test1/test2.d @@ -0,0 +1,13 @@ +import std.stdio; + +struct X { +} + +extern(C) int _ZN1X1yEv(X* _this); +extern(C) X* _Z5SomeXv(); + +void main() { + X *x = _Z5SomeXv(); + int i = _ZN1X1yEv(x); + writeln("i: ", i); +} diff --git a/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_dmd.py b/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_dmd.py new file mode 100644 index 0000000..2446a28 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_dmd.py @@ -0,0 +1,37 @@ +""" +Test compiling and executing using the gdc tool. +""" + +# +# __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__" + +from Common.correctLinkOptions import testForTool +testForTool('dmd') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_gdc.py b/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_gdc.py new file mode 100644 index 0000000..baf2921 --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_gdc.py @@ -0,0 +1,37 @@ +""" +Test compiling and executing using the gdc tool. +""" + +# +# __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__" + +from Common.correctLinkOptions import testForTool +testForTool('gdc') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_ldc.py b/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_ldc.py new file mode 100644 index 0000000..a61a94b --- /dev/null +++ b/test/D/Issues/2940_Ariovistus/sconstest-correctLinkOptions_ldc.py @@ -0,0 +1,37 @@ +""" +Test compiling and executing using the gdc tool. +""" + +# +# __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__" + +from Common.correctLinkOptions import testForTool +testForTool('ldc') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2944/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2944/D_changed_DFLAGS_not_rebuilding.py new file mode 100644 index 0000000..1d9854f --- /dev/null +++ b/test/D/Issues/2944/D_changed_DFLAGS_not_rebuilding.py @@ -0,0 +1,23 @@ +# 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/2944/image/SConstruct b/test/D/Issues/2944/image/SConstruct new file mode 100644 index 0000000..2c7deee --- /dev/null +++ b/test/D/Issues/2944/image/SConstruct @@ -0,0 +1,11 @@ +# -*- codig:utf-8; -*- + +env=Environment() + +change = ARGUMENTS.get('change', 0) +if int(change): + env.Append(DFLAGS = '-d') + +env.Program('proj', ['main.d']) + + diff --git a/test/D/Issues/2944/image/main.d b/test/D/Issues/2944/image/main.d new file mode 100644 index 0000000..f0aa23a --- /dev/null +++ b/test/D/Issues/2944/image/main.d @@ -0,0 +1,11 @@ +/* This program prints a + hello world message + to the console. */ + +import std.stdio; + +void main() +{ + writeln("Hello, World!"); +} + |
