diff options
author | Mats Wichmann <mats@linux.com> | 2019-12-15 16:08:10 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-12-15 16:08:10 (GMT) |
commit | 063a3281b4fe7f43a34c0e65dfd3a02446ba12f8 (patch) | |
tree | 743a54f36001856c04edb4c36e4a77bdd4a9edb4 /test | |
parent | ac61e3fead14db2d61ac449d458c04f4bba4053f (diff) | |
download | SCons-063a3281b4fe7f43a34c0e65dfd3a02446ba12f8.zip SCons-063a3281b4fe7f43a34c0e65dfd3a02446ba12f8.tar.gz SCons-063a3281b4fe7f43a34c0e65dfd3a02446ba12f8.tar.bz2 |
[PR #3497] add the missing testcases
forgot to add these to the initial commit
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/Removed/BuildDir/BuildDir.py | 61 | ||||
-rw-r--r-- | test/Removed/BuildDir/SConscript-build_dir.py | 54 |
2 files changed, 115 insertions, 0 deletions
diff --git a/test/Removed/BuildDir/BuildDir.py b/test/Removed/BuildDir/BuildDir.py new file mode 100644 index 0000000..43c8b8b --- /dev/null +++ b/test/Removed/BuildDir/BuildDir.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Verify that the BuildDir function and method no longer work. +""" + +import TestSCons + +_exe = TestSCons._exe + +test = TestSCons.TestSCons(match=TestSCons.match_exact) + +test.subdir('src') + +test.file_fixture('SConstruct.global', 'SConstruct') +expect = """\ +NameError: name 'BuildDir' is not defined: + File "{}", line 1: + BuildDir('build', 'src') +""".format(test.workpath('SConstruct')) +test.run(arguments='-Q -s', status=2, stderr=expect) + +test.file_fixture('SConstruct.method', 'SConstruct') +expect = """\ +AttributeError: 'SConsEnvironment' object has no attribute 'BuildDir': + File "{}", line 3: + env.BuildDir('build', 'src') +""".format(test.workpath('SConstruct')) +test.run(arguments='-Q -s', status=2, stderr=expect) + + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Removed/BuildDir/SConscript-build_dir.py b/test/Removed/BuildDir/SConscript-build_dir.py new file mode 100644 index 0000000..55be7b1 --- /dev/null +++ b/test/Removed/BuildDir/SConscript-build_dir.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Verify that specifying a build_dir argument to SConscript no longer works. +""" + +import TestSCons + +test = TestSCons.TestSCons(match = TestSCons.match_exact) + +test.file_fixture('SConstruct.kwarg', 'SConstruct') +test.subdir('src') +test.write(['src', 'SConscript'], """ +""") + +# this doesn't work yet +expect = """\ +TypeError: SConscript() got an unexpected keyword argument 'build_dir': + File "{}", line 1: + SConscript('src/SConscript', build_dir='build') +""".format(test.workpath('SConstruct')) +test.run(arguments='-Q -s', status=2, stderr=expect) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: |