diff options
author | Mats Wichmann <mats@linux.com> | 2019-09-11 16:57:57 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-09-12 13:47:40 (GMT) |
commit | 2781e4e52b0910c408b0ffc7c0bc1b511a42a754 (patch) | |
tree | c1f5e13c370446abec1f9a39672df85466a3a749 | |
parent | eacd78c2b40a157977d22be5fa195b73e16befdb (diff) | |
download | SCons-2781e4e52b0910c408b0ffc7c0bc1b511a42a754.zip SCons-2781e4e52b0910c408b0ffc7c0bc1b511a42a754.tar.gz SCons-2781e4e52b0910c408b0ffc7c0bc1b511a42a754.tar.bz2 |
Remove deprecated debug options
These options have been deprecated since 2007. They were originally
announced to be disabled in SCons 2.0.0, but that didn't happen.
Left the deprecated-debug-options behavior is in, but the dictionary of
such options is now empty, and there's a new dict of removed options,
and presence in that dict raises an exception.
The four tests that were in test/Deprecated move to a new directory
test/Removed and are simplified just to make sure invocation errors
scons out. (git interprets most of these as remove/add for some reason)
These appear to have been already removed from docs, so no doc impact.
Signed-off-by: Mats Wichmann <mats@linux.com>
-rwxr-xr-x | src/CHANGES.txt | 1 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConsOptions.py | 20 | ||||
-rw-r--r-- | test/Deprecated/debug-dtree.py | 120 | ||||
-rw-r--r-- | test/Deprecated/debug-stree.py | 139 | ||||
-rw-r--r-- | test/Deprecated/debug-tree.py | 160 | ||||
-rw-r--r-- | test/Removed/debug-dtree.py | 57 | ||||
-rw-r--r-- | test/Removed/debug-nomemoizer.py (renamed from test/Deprecated/debug-nomemoizer.py) | 28 | ||||
-rw-r--r-- | test/Removed/debug-stree.py | 57 | ||||
-rw-r--r-- | test/Removed/debug-tree.py | 57 |
9 files changed, 201 insertions, 438 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 87f4e28..dd7f9bd 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -15,6 +15,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Mats Wichmann - Replace instances of string find method with "in" checks where the index from find() was not used. + - Turn previously deprecated debug options into failures. RELEASE 3.1.1 - Mon, 07 Aug 2019 20:09:12 -0500 diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index c45cb01..add1150 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -584,9 +584,15 @@ def Parser(version): help="Print build actions for files from CacheDir.") def opt_invalid(group, value, options): + """report an invalid option from a group""" errmsg = "`%s' is not a valid %s option type, try:\n" % (value, group) return errmsg + " %s" % ", ".join(options) + def opt_invalid_rm(group, value, msg): + """report an invalid option from a group: recognized but removed""" + errmsg = "`%s' is not a valid %s option type " % (value, group) + return errmsg + msg + config_options = ["auto", "force" ,"cache"] opt_config_help = "Controls Configure subsystem: %s." \ @@ -604,9 +610,11 @@ def Parser(version): help="Search up directory tree for SConstruct, " "build all Default() targets.") - deprecated_debug_options = { + deprecated_debug_options = {} + + removed_debug_options = { "dtree" : '; please use --tree=derived instead', - "nomemoizer" : ' and has no effect', + "nomemoizer" : '; there is no replacement', "stree" : '; please use --tree=all,status instead', "tree" : '; please use --tree=all instead', } @@ -618,11 +626,12 @@ def Parser(version): def opt_debug(option, opt, value__, parser, debug_options=debug_options, - deprecated_debug_options=deprecated_debug_options): + deprecated_debug_options=deprecated_debug_options, + removed_debug_options=removed_debug_options): for value in value__.split(','): if value in debug_options: parser.values.debug.append(value) - elif value in list(deprecated_debug_options.keys()): + elif value in deprecated_debug_options: parser.values.debug.append(value) try: parser.values.delayed_warnings @@ -632,6 +641,9 @@ def Parser(version): w = "The --debug=%s option is deprecated%s." % (value, msg) t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) parser.values.delayed_warnings.append(t) + elif value in removed_debug_options: + msg = removed_debug_options[value] + raise OptionValueError(opt_invalid_rm('debug', value, msg)) else: raise OptionValueError(opt_invalid('debug', value, debug_options)) diff --git a/test/Deprecated/debug-dtree.py b/test/Deprecated/debug-dtree.py deleted file mode 100644 index 1e7366f..0000000 --- a/test/Deprecated/debug-dtree.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/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__" - -""" -Test that the --debug=dtree option correctly prints just the explicit -dependencies (sources or Depends()) of a target. -""" - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -test.write('SConstruct', """ -env = Environment(OBJSUFFIX = '.ooo', PROGSUFFIX = '.xxx') -env.Program('foo', Split('foo.c bar.c')) -""") - -test.write('foo.c', r""" -#include <stdio.h> -#include <stdlib.h> -#include "foo.h" -int main(int argc, char *argv[]) -{ - argv[argc++] = "--"; - printf("f1.c\n"); - exit (0); -} -""") - -test.write('bar.c', """ -#include "bar.h" -int local = 1; -""") - -test.write('foo.h', """ -#ifndef FOO_H -#define FOO_H -#include "bar.h" -#endif -""") - -test.write('bar.h', """ -#ifndef BAR_H -#define BAR_H -#include "foo.h" -#endif -""") - -expect = """ -scons: warning: The --debug=dtree option is deprecated; please use --tree=derived instead. -""" - -stderr = TestSCons.re_escape(expect) + TestSCons.file_expr - -dtree1 = """ -+-foo.xxx - +-foo.ooo - +-bar.ooo -""" - -test.run(arguments = "--debug=dtree foo.xxx", - stderr = stderr) -test.must_contain_all_lines(test.stdout(), [dtree1]) - -dtree2 = """ -+-. - +-bar.ooo - +-foo.ooo - +-foo.xxx - +-foo.ooo - +-bar.ooo -""" -test.run(arguments = "--debug=dtree .", - stderr = stderr) -test.must_contain_all_lines(test.stdout(), [dtree2]) - -# Make sure we print the debug stuff even if there's a build failure. -test.write('bar.h', """ -#ifndef BAR_H -#define BAR_H -#include "foo.h" -#endif -THIS SHOULD CAUSE A BUILD FAILURE -""") - -test.run(arguments = "--debug=dtree foo.xxx", - status = 2, - stderr = None) -test.must_contain_all_lines(test.stdout(), [dtree1]) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/debug-stree.py b/test/Deprecated/debug-stree.py deleted file mode 100644 index 907dedf..0000000 --- a/test/Deprecated/debug-stree.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/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__" - -""" -Test that the --debug=stree option prints a dependency tree with output -that indicates the state of various Node status flags. -""" - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -CC = test.detect('CC') -LINK = test.detect('LINK') -if LINK is None: LINK = CC - -test.write('SConstruct', """ -env = Environment(OBJSUFFIX = '.ooo', PROGSUFFIX = '.xxx') -env.Program('foo', Split('foo.c bar.c')) -""") - -test.write('foo.c', r""" -#include <stdio.h> -#include <stdlib.h> -#include "foo.h" -int main(int argc, char *argv[]) -{ - argv[argc++] = "--"; - printf("f1.c\n"); - exit (0); -} -""") - -test.write('bar.c', """ -#include "bar.h" -int local = 1; -""") - -test.write('foo.h', """ -#ifndef FOO_H -#define FOO_H -#include "bar.h" -#endif -""") - -test.write('bar.h', """ -#ifndef BAR_H -#define BAR_H -#include "foo.h" -#endif -""") - -expect = """ -scons: warning: The --debug=stree option is deprecated; please use --tree=all,status instead. -""" - -stderr = TestSCons.re_escape(expect) + TestSCons.file_expr - -stree = """ -[E B C ]+-foo.xxx -[E B C ] +-foo.ooo -[E C ] | +-foo.c -[E C ] | +-foo.h -[E C ] | +-bar.h -[E C ] | +-%(CC)s -[E B C ] +-bar.ooo -[E C ] | +-bar.c -[E C ] | +-bar.h -[E C ] | +-foo.h -[E C ] | +-%(CC)s -[E C ] +-%(LINK)s -""" % locals() - -test.run(arguments = "--debug=stree foo.xxx", - stderr = stderr) -test.fail_test(test.stdout().count(stree) != 1) - -stree2 = """ - E = exists - R = exists in repository only - b = implicit builder - B = explicit builder - S = side effect - P = precious - A = always build - C = current - N = no clean - H = no cache - -[ B ]+-foo.xxx -[ B ] +-foo.ooo -[E C ] | +-foo.c -[E C ] | +-foo.h -[E C ] | +-bar.h -[E C ] | +-%(CC)s -[ B ] +-bar.ooo -[E C ] | +-bar.c -[E C ] | +-bar.h -[E C ] | +-foo.h -[E C ] | +-%(CC)s -[E C ] +-%(LINK)s -""" % locals() - -test.run(arguments = '-c foo.xxx') - -test.run(arguments = "--no-exec --debug=stree foo.xxx", - stderr = stderr) -test.fail_test(test.stdout().count(stree2) != 1) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/debug-tree.py b/test/Deprecated/debug-tree.py deleted file mode 100644 index 51ff7f2..0000000 --- a/test/Deprecated/debug-tree.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/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__" - -""" -Test that the --debug=tree option prints a tree representation of the -complete dependencies of a target. -""" - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -CC = test.detect('CC') -LINK = test.detect('LINK') -if LINK is None: LINK = CC - -test.write('SConstruct', """ -env = Environment(OBJSUFFIX = '.ooo', PROGSUFFIX = '.xxx') -env.Program('Foo', Split('Foo.c Bar.c')) -""") - -# N.B.: We use upper-case file names (Foo* and Bar*) so that the sorting -# order with our upper-case SConstruct file is the same on case-sensitive -# (UNIX/Linux) and case-insensitive (Windows) systems. - -test.write('Foo.c', r""" -#include <stdio.h> -#include <stdlib.h> -#include "Foo.h" -int main(int argc, char *argv[]) -{ - argv[argc++] = "--"; - printf("f1.c\n"); - exit (0); -} -""") - -test.write('Bar.c', """ -#include "Bar.h" -int local = 1; -""") - -test.write('Foo.h', """ -#ifndef FOO_H -#define FOO_H -#include "Bar.h" -#endif -""") - -test.write('Bar.h', """ -#ifndef BAR_H -#define BAR_H -#include "Foo.h" -#endif -""") - -expect = """ -scons: warning: The --debug=tree option is deprecated; please use --tree=all instead. -""" - -stderr = TestSCons.re_escape(expect) + TestSCons.file_expr - -tree1 = """ -+-Foo.xxx - +-Foo.ooo - | +-Foo.c - | +-Foo.h - | +-Bar.h - | +-%(CC)s - +-Bar.ooo - | +-Bar.c - | +-Bar.h - | +-Foo.h - | +-%(CC)s - +-%(LINK)s -""" % locals() - -test.run(arguments = "--debug=tree Foo.xxx", - stderr = stderr) -test.must_contain_all_lines(test.stdout(), tree1) - -tree2 = """ -+-. - +-Bar.c - +-Bar.h - +-Bar.ooo - | +-Bar.c - | +-Bar.h - | +-Foo.h - | +-%(CC)s - +-Foo.c - +-Foo.h - +-Foo.ooo - | +-Foo.c - | +-Foo.h - | +-Bar.h - | +-%(CC)s - +-Foo.xxx - | +-Foo.ooo - | | +-Foo.c - | | +-Foo.h - | | +-Bar.h - | | +-%(CC)s - | +-Bar.ooo - | | +-Bar.c - | | +-Bar.h - | | +-Foo.h - | | +-%(CC)s - | +-%(LINK)s - +-SConstruct -""" % locals() - -test.run(arguments = "--debug=tree .", - stderr = stderr) -test.must_contain_all_lines(test.stdout(), tree2) - -# Make sure we print the debug stuff even if there's a build failure. -test.write('Bar.h', """ -#ifndef BAR_H -#define BAR_H -#include "Foo.h" -#endif -THIS SHOULD CAUSE A BUILD FAILURE -""") - -test.run(arguments = "--debug=tree Foo.xxx", - status = 2, - stderr = None) -test.must_contain_all_lines(test.stdout(), tree1) - -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/debug-dtree.py b/test/Removed/debug-dtree.py new file mode 100644 index 0000000..a016f96 --- /dev/null +++ b/test/Removed/debug-dtree.py @@ -0,0 +1,57 @@ +#!/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__" + +""" +Test that the --debug=dtree option fails with expected exception +""" + +import os + +import TestSCons + +test = TestSCons.TestSCons() + + +test.write('SConstruct', "") + +expect = r"""usage: scons [OPTION] [TARGET] ... + +SCons Error: `dtree' is not a valid debug option type ; please use --tree=derived instead +""" + +test.run(arguments='-Q --debug=dtree', status=2, stderr=expect) + +os.environ['SCONSFLAGS'] = '--debug=dtree' +test.run(arguments="-H", 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/Deprecated/debug-nomemoizer.py b/test/Removed/debug-nomemoizer.py index 6d05cb2..a830a88 100644 --- a/test/Deprecated/debug-nomemoizer.py +++ b/test/Removed/debug-nomemoizer.py @@ -25,30 +25,28 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ -Test calling the (deprecated) --debug=nomemoizer option. +Test that the --debug=nomemoizer option fails with expected exception """ +import os + import TestSCons -test = TestSCons.TestSCons(match = TestSCons.match_re) +test = TestSCons.TestSCons() + -test.write('SConstruct', """ -def cat(target, source, env): - with open(str(target[0]), 'wb') as ofp, open(str(source[0]), 'rb') as ifp: - ofp.write(ifp.read()) -env = Environment(BUILDERS={'Cat':Builder(action=Action(cat))}) -env.Cat('file.out', 'file.in') -""") +test.write('SConstruct', "") -test.write('file.in', "file.in\n") +expect=r"""usage: scons [OPTION] [TARGET] ... + +SCons Error: `nomemoizer' is not a valid debug option type ; there is no replacement +""" -expect = """ -scons: warning: The --debug=nomemoizer option is deprecated and has no effect. -""" + TestSCons.file_expr +test.run(arguments='-Q --debug=nomemoizer', status=2, stderr=expect) -test.run(arguments = "--debug=nomemoizer", stderr = expect) +os.environ['SCONSFLAGS'] = '--debug=nomemoizer' +test.run(arguments="-H", status=2, stderr=expect) -test.must_match('file.out', "file.in\n") test.pass_test() diff --git a/test/Removed/debug-stree.py b/test/Removed/debug-stree.py new file mode 100644 index 0000000..60ce4f2 --- /dev/null +++ b/test/Removed/debug-stree.py @@ -0,0 +1,57 @@ +#!/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__" + +""" +Test that the --debug=stree option fails with expected exception +""" + +import os + +import TestSCons + +test = TestSCons.TestSCons() + + +test.write('SConstruct', "") + +expect = r"""usage: scons [OPTION] [TARGET] ... + +SCons Error: `stree' is not a valid debug option type ; please use --tree=all,status instead +""" + +test.run(arguments='-Q --debug=stree', status=2, stderr=expect) + +os.environ['SCONSFLAGS'] = '--debug=stree' +test.run(arguments="-H", 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/debug-tree.py b/test/Removed/debug-tree.py new file mode 100644 index 0000000..73aa4c9 --- /dev/null +++ b/test/Removed/debug-tree.py @@ -0,0 +1,57 @@ +#!/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__" + +""" +Test that the --debug=tree option fails with expected exception +""" + +import os + +import TestSCons + +test = TestSCons.TestSCons() + + +test.write('SConstruct', "") + +expect = r"""usage: scons [OPTION] [TARGET] ... + +SCons Error: `tree' is not a valid debug option type ; please use --tree=all instead +""" + +test.run(arguments='-Q --debug=tree', status=2, stderr=expect) + +os.environ['SCONSFLAGS'] = '--debug=tree' +test.run(arguments="-H", status=2, stderr=expect) + + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: |