summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Managan <ramanagan@att.net>2012-12-15 06:00:17 (GMT)
committerRobert Managan <ramanagan@att.net>2012-12-15 06:00:17 (GMT)
commita27fa15ddc3af3e1ee3dfe2488fa499ba906dfda (patch)
tree737dc474ead899b9157657453364730679816a47
parent3cf978d7964fb474f8a6219f48008f07913aabec (diff)
parent1bf9aa83fc024950012dd76d110443fc2d30c92a (diff)
downloadSCons-a27fa15ddc3af3e1ee3dfe2488fa499ba906dfda.zip
SCons-a27fa15ddc3af3e1ee3dfe2488fa499ba906dfda.tar.gz
SCons-a27fa15ddc3af3e1ee3dfe2488fa499ba906dfda.tar.bz2
merge in changes from SCons default
-rw-r--r--QMTest/TestSCons_time.py20
-rw-r--r--README.rst1
-rw-r--r--admin/.aeignore5
-rw-r--r--doc/SConscript1
-rwxr-xr-xruntest.py21
-rw-r--r--src/Announce.txt2
-rw-r--r--src/CHANGES.txt12
-rw-r--r--src/engine/SCons/Optik/.aeignore5
-rw-r--r--src/engine/SCons/Script/SConsOptions.py39
-rw-r--r--src/engine/SCons/Script/SConscript.py9
-rw-r--r--src/engine/SCons/Tool/wix.py27
-rw-r--r--src/engine/SCons/Tool/wixTests.py62
-rw-r--r--src/engine/SCons/compat/_scons_builtins.py43
-rw-r--r--src/script/scons.py28
-rw-r--r--test/Deprecated/SourceCode/Perforce/Perforce.py9
-rw-r--r--test/EnsurePythonVersion.py52
-rw-r--r--test/option--duplicate.py3
-rw-r--r--test/option--tree.py60
-rw-r--r--test/option-unknown.py4
19 files changed, 203 insertions, 200 deletions
diff --git a/QMTest/TestSCons_time.py b/QMTest/TestSCons_time.py
index ce9e0df..4a759c0 100644
--- a/QMTest/TestSCons_time.py
+++ b/QMTest/TestSCons_time.py
@@ -175,26 +175,6 @@ class TestSCons_time(TestCommon):
TestCommon.__init__(self, **kw)
- # Now that the testing object has been set up, check if we should
- # skip the test due to the Python version. We need to be able to
- # import __future__ (which scons-time.py uses for nested scopes)
- # and to handle list comprehensions (just because we're avoiding
- # the old map() and filter() idioms).
-
- try:
- import __future__
- except ImportError:
- version = sys.version.split()[0]
- msg = 'scons-time does not work on Python version %s\n' % version
- self.skip_test(msg)
-
- try:
- eval('[x for x in [1, 2]]')
- except SyntaxError:
- version = sys.version.split()[0]
- msg = 'scons-time does not work on Python version %s\n' % version
- self.skip_test(msg)
-
def archive_split(self, path):
if path[-7:] == '.tar.gz':
return path[:-7], path[-7:]
diff --git a/README.rst b/README.rst
index d2492ba..862d323 100644
--- a/README.rst
+++ b/README.rst
@@ -751,3 +751,4 @@ With plenty of help from the SCons Development team:
\... and many others.
__COPYRIGHT__
+
diff --git a/admin/.aeignore b/admin/.aeignore
deleted file mode 100644
index 22ebd62..0000000
--- a/admin/.aeignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*,D
-*.pyc
-.*.swp
-.consign
-.sconsign
diff --git a/doc/SConscript b/doc/SConscript
index 9bf40bc..a3d6fe7 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -544,7 +544,6 @@ else:
e = os.path.join('#src', 'engine')
manifest_in = File(os.path.join(e, 'MANIFEST.in')).rstr()
sources = [x[:-1] for x in open(manifest_in).readlines()]
- sources = [x for x in sources if x.find('Optik') == -1]
sources = [x for x in sources if x.find('Platform') == -1]
sources = [x for x in sources if x.find('Tool') == -1]
# XXX
diff --git a/runtest.py b/runtest.py
index a88cfd2..55a16f5 100755
--- a/runtest.py
+++ b/runtest.py
@@ -390,22 +390,11 @@ if use_subprocess:
else:
has_subprocess = False
# Set up lowest-common-denominator spawning of a process on both Windows
- # and non-Windows systems that works all the way back to Python 1.5.2.
- try:
- os.spawnv
- except AttributeError:
- def spawn_it(command_args):
- pid = os.fork()
- if pid == 0:
- os.execv(command_args[0], command_args)
- else:
- pid, status = os.waitpid(pid, 0)
- return (None, None, status >> 8)
- else:
- def spawn_it(command_args):
- command = command_args[0]
- command_args = [escape(c) for c in command_args]
- return (None, None, os.spawnv(os.P_WAIT, command, command_args))
+ # and non-Windows systems that works all the way back to Python 1.6
+ def spawn_it(command_args):
+ command = command_args[0]
+ command_args = [escape(c) for c in command_args]
+ return (None, None, os.spawnv(os.P_WAIT, command, command_args))
class Base(object):
def __init__(self, path, spe=None):
diff --git a/src/Announce.txt b/src/Announce.txt
index e2b4001..a2197a1 100644
--- a/src/Announce.txt
+++ b/src/Announce.txt
@@ -19,7 +19,7 @@ effectively, please go to http://scons.org/lists.php#users to sign up for
the scons-users mailing list.
-RELEASE 2.2.0 - Mon, 09 Sep 2011 20:54:57 -0700
+RELEASE 2.2.0 - Mon, 05 Aug 2012 15:37:48 +0000
Please consult the RELEASE.txt file for a summary of changes since the last
release and consult the CHANGES.txt file for complete a list of changes
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 33fa239..994cc71 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -6,6 +6,15 @@
RELEASE 2.X.X -
+ From Anatoly Techtonik:
+ - Added ability to run scripts/scons.py directly from source checkout
+ - Hide deprecated --debug={dtree,stree,tree} from --help output
+ - Error messages from option parser now include hints about valid choices
+
+ From Juan Lang:
+ - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output
+ - Support building with WiX releases after 2.0
+
From Alexey Klimkin:
- Fix nested LIBPATH expansion by flattening sequences in subst_path.
@@ -1761,6 +1770,9 @@ RELEASE 0.97.0d20070809 - Fri, 10 Aug 2007 10:51:27 -0500
- Add a new AddOption() function to support user-defined command-
line flags (like --prefix=, --force, etc.).
+ - Replace modified Optik version with new optparse compatibility module
+ for command line processing in Scripts/SConsOptions.py
+
- Push and retrieve built symlinks to/from a CacheDir() as actual
symlinks, not by copying the file contents.
diff --git a/src/engine/SCons/Optik/.aeignore b/src/engine/SCons/Optik/.aeignore
deleted file mode 100644
index 22ebd62..0000000
--- a/src/engine/SCons/Optik/.aeignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*,D
-*.pyc
-.*.swp
-.consign
-.sconsign
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index 3066c65..645ab11 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -268,8 +268,9 @@ class SConsOptionParser(optparse.OptionParser):
preserve_unknown_options = False
def error(self, msg):
+ # overriden OptionValueError exception handler
self.print_usage(sys.stderr)
- sys.stderr.write("SCons error: %s\n" % msg)
+ sys.stderr.write("SCons Error: %s\n" % msg)
sys.exit(2)
def _process_long_opt(self, rargs, values):
@@ -568,11 +569,15 @@ def Parser(version):
action="store_true",
help="Print build actions for files from CacheDir.")
+ def opt_invalid(group, value, options):
+ errmsg = "`%s' is not a valid %s option type, try:\n" % (value, group)
+ return errmsg + " %s" % ", ".join(options)
+
config_options = ["auto", "force" ,"cache"]
def opt_config(option, opt, value, parser, c_options=config_options):
if not value in c_options:
- raise OptionValueError("Warning: %s is not a valid config type" % value)
+ raise OptionValueError(opt_invalid('config', value, c_options))
setattr(parser.values, option.dest, value)
opt_config_help = "Controls Configure subsystem: %s." \
% ", ".join(config_options)
@@ -599,24 +604,25 @@ def Parser(version):
debug_options = ["count", "duplicate", "explain", "findlibs",
"includes", "memoizer", "memory", "objects",
"pdb", "prepare", "presub", "stacktrace",
- "time"] + list(deprecated_debug_options.keys())
+ "time"]
def opt_debug(option, opt, value, parser,
debug_options=debug_options,
deprecated_debug_options=deprecated_debug_options):
if value in debug_options:
parser.values.debug.append(value)
- if value in deprecated_debug_options.keys():
- try:
- parser.values.delayed_warnings
- except AttributeError:
- parser.values.delayed_warnings = []
- msg = deprecated_debug_options[value]
- w = "The --debug=%s option is deprecated%s." % (value, msg)
- t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)
- parser.values.delayed_warnings.append(t)
+ elif value in deprecated_debug_options.keys():
+ parser.values.debug.append(value)
+ try:
+ parser.values.delayed_warnings
+ except AttributeError:
+ parser.values.delayed_warnings = []
+ msg = deprecated_debug_options[value]
+ w = "The --debug=%s option is deprecated%s." % (value, msg)
+ t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)
+ parser.values.delayed_warnings.append(t)
else:
- raise OptionValueError("Warning: %s is not a valid debug type" % value)
+ raise OptionValueError(opt_invalid('debug', value, debug_options))
opt_debug_help = "Print various types of debugging information: %s." \
% ", ".join(debug_options)
op.add_option('--debug',
@@ -630,7 +636,7 @@ def Parser(version):
try:
diskcheck_value = diskcheck_convert(value)
except ValueError, e:
- raise OptionValueError("Warning: `%s' is not a valid diskcheck type" % e)
+ raise OptionValueError("`%s' is not a valid diskcheck type" % e)
setattr(parser.values, option.dest, diskcheck_value)
op.add_option('--diskcheck',
@@ -642,7 +648,8 @@ def Parser(version):
def opt_duplicate(option, opt, value, parser):
if not value in SCons.Node.FS.Valid_Duplicates:
- raise OptionValueError("`%s' is not a valid duplication style." % value)
+ raise OptionValueError(opt_invalid('duplication', value,
+ SCons.Node.FS.Valid_Duplicates))
setattr(parser.values, option.dest, value)
# Set the duplicate style right away so it can affect linking
# of SConscript files.
@@ -807,7 +814,7 @@ def Parser(version):
elif o == 'status':
tp.status = True
else:
- raise OptionValueError("Warning: %s is not a valid --tree option" % o)
+ raise OptionValueError(opt_invalid('--tree', o, tree_options))
parser.values.tree_printers.append(tp)
opt_tree_help = "Print a dependency tree in various formats: %s." \
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index aa555da..bd515d2 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -473,13 +473,8 @@ class SConsEnvironment(SCons.Environment.Base):
def EnsurePythonVersion(self, major, minor):
"""Exit abnormally if the Python version is not late enough."""
- try:
- v_major, v_minor, v_micro, release, serial = sys.version_info
- python_ver = (v_major, v_minor)
- except AttributeError:
- python_ver = self._get_major_minor_revision(sys.version)[:2]
- if python_ver < (major, minor):
- v = sys.version.split(" ", 1)[0]
+ if sys.version_info < (major, minor):
+ v = sys.version.split()[0]
print "Python %d.%d or greater required, but you have Python %s" %(major,minor,v)
sys.exit(2)
diff --git a/src/engine/SCons/Tool/wix.py b/src/engine/SCons/Tool/wix.py
index 32cc1f1..04136ce 100644
--- a/src/engine/SCons/Tool/wix.py
+++ b/src/engine/SCons/Tool/wix.py
@@ -47,15 +47,17 @@ def generate(env):
env['WIXLIGHTFLAGS'].append( '-nologo' )
env['WIXLIGHTCOM'] = "$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}"
+ env['WIXSRCSUF'] = '.wxs'
+ env['WIXOBJSUF'] = '.wixobj'
object_builder = SCons.Builder.Builder(
action = '$WIXCANDLECOM',
- suffix = '.wxiobj',
- src_suffix = '.wxs')
+ suffix = '$WIXOBJSUF',
+ src_suffix = '$WIXSRCSUF')
linker_builder = SCons.Builder.Builder(
action = '$WIXLIGHTCOM',
- src_suffix = '.wxiobj',
+ src_suffix = '$WIXOBJSUF',
src_builder = object_builder)
env['BUILDERS']['WiX'] = linker_builder
@@ -66,7 +68,6 @@ def exists(env):
# try to find the candle.exe and light.exe tools and
# add the install directory to light libpath.
- #for path in os.environ['PATH'].split(os.pathsep):
for path in os.environ['PATH'].split(os.pathsep):
if not path:
continue
@@ -80,13 +81,17 @@ def exists(env):
# search for the tools in the PATH environment variable
try:
- if env['WIXCANDLE'] in os.listdir(path) and\
- env['WIXLIGHT'] in os.listdir(path):
- env.PrependENVPath('PATH', path)
- env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),
- '-loc',
- os.path.join( path, 'WixUI_en-us.wxl' ) ]
- return 1
+ files = os.listdir(path)
+ if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files:
+ env.PrependENVPath('PATH', path)
+ # include appropriate flags if running WiX 2.0
+ if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files:
+ env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),
+ '-loc',
+ os.path.join( path, 'WixUI_en-us.wxl' ) ]
+ else:
+ env['WIXLIGHTFLAGS'] = []
+ return 1
except OSError:
pass # ignore this, could be a stale PATH entry.
diff --git a/src/engine/SCons/Tool/wixTests.py b/src/engine/SCons/Tool/wixTests.py
new file mode 100644
index 0000000..c815dd0
--- /dev/null
+++ b/src/engine/SCons/Tool/wixTests.py
@@ -0,0 +1,62 @@
+#
+# __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 unittest
+import os.path
+import os
+import sys
+
+import SCons.Errors
+from SCons.Tool.wix import *
+from SCons.Environment import Environment
+
+import TestCmd
+
+# create fake candle and light, so the tool's exists() method will succeed
+test = TestCmd.TestCmd(workdir = '')
+test.write('candle.exe', 'rem this is candle')
+test.write('light.exe', 'rem this is light')
+os.environ['PATH'] += os.pathsep + test.workdir
+
+class WixTestCase(unittest.TestCase):
+ def test_vars(self):
+ """Test that WiX tool adds vars"""
+ env = Environment(tools=['wix'])
+ assert env['WIXCANDLE'] is not None
+ assert env['WIXCANDLEFLAGS'] is not None
+ assert env['WIXLIGHTFLAGS'] is not None
+ assert env.subst('$WIXOBJSUF') == '.wixobj'
+ assert env.subst('$WIXSRCSUF') == '.wxs'
+
+if __name__ == "__main__":
+ suite = unittest.makeSuite(WixTestCase, 'test_')
+ if not unittest.TextTestRunner().run(suite).wasSuccessful():
+ sys.exit(1)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/compat/_scons_builtins.py b/src/engine/SCons/compat/_scons_builtins.py
index 3c8a0e5..6218cd1 100644
--- a/src/engine/SCons/compat/_scons_builtins.py
+++ b/src/engine/SCons/compat/_scons_builtins.py
@@ -37,7 +37,6 @@ This module checks for the following builtins names:
all()
any()
- sorted()
memoryview()
Implementations of functions are *NOT* guaranteed to be fully compliant
@@ -101,48 +100,6 @@ except NameError:
return self.obj[indx]
builtins.memoryview = memoryview
-try:
- sorted
-except NameError:
- # Pre-2.4 Python has no sorted() function.
- #
- # The pre-2.4 Python list.sort() method does not support
- # list.sort(key=) nor list.sort(reverse=) keyword arguments, so
- # we must implement the functionality of those keyword arguments
- # by hand instead of passing them to list.sort().
- def sorted(iterable, cmp=None, key=None, reverse=False):
- if key is not None:
- result = [(key(x), x) for x in iterable]
- else:
- result = iterable[:]
- if cmp is None:
- # Pre-2.3 Python does not support list.sort(None).
- result.sort()
- else:
- result.sort(cmp)
- if key is not None:
- result = [t1 for t0,t1 in result]
- if reverse:
- result.reverse()
- return result
- builtins.sorted = sorted
-
-#if sys.version_info[:3] in ((2, 2, 0), (2, 2, 1)):
-# def lstrip(s, c=string.whitespace):
-# while s and s[0] in c:
-# s = s[1:]
-# return s
-# def rstrip(s, c=string.whitespace):
-# while s and s[-1] in c:
-# s = s[:-1]
-# return s
-# def strip(s, c=string.whitespace, l=lstrip, r=rstrip):
-# return l(r(s, c), c)
-#
-# object.__setattr__(str, 'lstrip', lstrip)
-# object.__setattr__(str, 'rstrip', rstrip)
-# object.__setattr__(str, 'strip', strip)
-
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
diff --git a/src/script/scons.py b/src/script/scons.py
index 86d2562..46e6d2b 100644
--- a/src/script/scons.py
+++ b/src/script/scons.py
@@ -55,18 +55,12 @@ import sys
# engine modules if they're in either directory.
-# Check to see if the python version is > 3.0 which is currently unsupported
-# If so exit with error message
-try:
- if sys.version_info >= (3,0,0):
- msg = "scons: *** SCons version %s does not run under Python version %s.\n\
-Python 3.0 and later are not yet supported.\n"
- sys.stderr.write(msg % (__version__, sys.version.split()[0]))
- sys.exit(1)
-except AttributeError:
- # Pre-1.6 Python has no sys.version_info
- # No need to check version as we then know the version is < 3.0.0 and supported
- pass
+if sys.version_info >= (3,0,0):
+ msg = "scons: *** SCons version %s does not run under Python version %s.\n\
+Python 3 is not yet supported.\n"
+ sys.stderr.write(msg % (__version__, sys.version.split()[0]))
+ sys.exit(1)
+
script_dir = sys.path[0]
@@ -184,7 +178,15 @@ sys.path = libs + sys.path
##############################################################################
if __name__ == "__main__":
- import SCons.Script
+ try:
+ import SCons.Script
+ except:
+ ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'engine')
+ if os.path.exists(ROOT):
+ sys.path += [ROOT]
+ print("SCons import failed. Trying to run from source directory")
+ import SCons.Script
+
# this does all the work, and calls sys.exit
# with the proper exit status when done.
SCons.Script.main()
diff --git a/test/Deprecated/SourceCode/Perforce/Perforce.py b/test/Deprecated/SourceCode/Perforce/Perforce.py
index d732b57..ebf9cfb 100644
--- a/test/Deprecated/SourceCode/Perforce/Perforce.py
+++ b/test/Deprecated/SourceCode/Perforce/Perforce.py
@@ -85,13 +85,8 @@ class TestPerforce(TestSCons.TestSCons):
# We don't use self.run() because the TestCmd logic will hang
# waiting for the daemon to exit, even when we pass it
# the -d option.
- try:
- spawnv = os.spawnv
- except AttributeError:
- os.system(' '.join(args))
- else:
- spawnv(os.P_NOWAIT, self.p4d, args)
- self.sleep(2)
+ os.spawnv(os.P_NOWAIT, self.p4d, args)
+ self.sleep(2)
else:
import socket
s = socket.socket()
diff --git a/test/EnsurePythonVersion.py b/test/EnsurePythonVersion.py
index 8e1a0f3..b40bc71 100644
--- a/test/EnsurePythonVersion.py
+++ b/test/EnsurePythonVersion.py
@@ -43,58 +43,6 @@ Exit(0)
test.run(status=2)
-test.write('SConstruct', """\
-import sys
-try:
- delattr(sys, 'version_info')
-except AttributeError:
- pass
-sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n'
-EnsurePythonVersion(1,3)
-Exit(0)
-""")
-
-test.run()
-
-test.write('SConstruct', """\
-import sys
-try:
- delattr(sys, 'version_info')
-except AttributeError:
- pass
-sys.version = '2.3+ (#0, Feb 24 2003, 19:13:11)\\n'
-EnsurePythonVersion(2,2)
-Exit(0)
-""")
-
-test.run()
-
-test.write('SConstruct', """\
-import sys
-try:
- delattr(sys, 'version_info')
-except AttributeError:
- pass
-sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n'
-EnsurePythonVersion(2,3)
-Exit(0)
-""")
-
-test.run()
-
-test.write('SConstruct', """\
-import sys
-try:
- delattr(sys, 'version_info')
-except AttributeError:
- pass
-sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n'
-EnsurePythonVersion(2,4)
-Exit(0)
-""")
-
-test.run(status=2)
-
test.pass_test()
diff --git a/test/option--duplicate.py b/test/option--duplicate.py
index 7524c96..cccc185 100644
--- a/test/option--duplicate.py
+++ b/test/option--duplicate.py
@@ -123,7 +123,8 @@ RunTest('copy', type, bss)
test.run(arguments='--duplicate=nonsense', status=2, stderr="""\
usage: scons [OPTION] [TARGET] ...
-SCons error: `nonsense' is not a valid duplication style.
+SCons Error: `nonsense' is not a valid duplication option type, try:
+ hard-soft-copy, soft-hard-copy, hard-copy, soft-copy, copy
""")
test.pass_test()
diff --git a/test/option--tree.py b/test/option--tree.py
new file mode 100644
index 0000000..a50433c
--- /dev/null
+++ b/test/option--tree.py
@@ -0,0 +1,60 @@
+#!/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__"
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', "")
+
+test.run(arguments = '-Q --tree=prune',
+ stdout = """scons: `.' is up to date.
++-.
+ +-SConstruct
+""")
+
+test.run(arguments = '-Q --tree=foofoo',
+ stderr = """usage: scons [OPTION] [TARGET] ...
+
+SCons Error: `foofoo' is not a valid --tree option type, try:
+ all, derived, prune, status
+""",
+ status = 2)
+
+test.run(arguments = '--debug=tree',
+ stderr = """
+scons: warning: The --debug=tree option is deprecated; please use --tree=all instead.
+.*
+""",
+ status = 0, match=TestSCons.match_re_dotall)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/option-unknown.py b/test/option-unknown.py
index cbda8dd..8b42762 100644
--- a/test/option-unknown.py
+++ b/test/option-unknown.py
@@ -33,14 +33,14 @@ test.write('SConstruct', "")
test.run(arguments = '-Z',
stderr = """usage: scons [OPTION] [TARGET] ...
-SCons error: no such option: -Z
+SCons Error: no such option: -Z
""",
status = 2)
test.run(arguments = '--ZizzerZazzerZuzz',
stderr = """usage: scons [OPTION] [TARGET] ...
-SCons error: no such option: --ZizzerZazzerZuzz
+SCons Error: no such option: --ZizzerZazzerZuzz
""",
status = 2)