Commits

Anonymous committed dc1e74d

Start the deprecation cycle for the BuildDir() method and the build_dir
keyword parameter.

Several existing tests were still using BuildDir() or build_dir; they were
converted to use VariantDir() and variant_dir.

New tests were added to validate that the --warn=deprecated-build-dir option
and the SetOption method did the right thing. This led to the discovery that
a commonly-used test pattern provided by the infrastructure gobbled up too
much, causing tests to succeed when they should have failed. Fixing the
pattern led to other tests needing to be fixed.

In the process, it was discovered that the SCONSFLAG environment variable was
not getting correctly reset to its original value. Fixing this also caused
additional tests to misbehave, requiring them to be updated.

And test/Sig.py, which tests the deprecated SCons.Sig module, was moved to
the test/Deprecated directory.

All in all, quite a lot of action for what was supposed to be a simple change.

Comments (0)

Files changed (32)

Announcement.txt

-__COPYRIGHT__
-__FILE__ __REVISION__ __DATE__ __DEVELOPER__
-SCons checkpoint release 1.2.0.d20090223 is now available at the SCons
-download page:
-
-        http://www.scons.org/download.php
-
-This checkpoint provides early access to new features and fixes
-scheduled for release in SCons 1.3.0.
-
-
-IMPORTANT:
-
-- This checkpoint release notably contains completely new code for
-  detecting installed versions of Microsoft Visual C/C++.  The new code
-  has been tested extensively, but it is possible that it will fail to
-  find installed versions on configurations that we don't have available
-  for testing.  Please report *any* problems with support for Microsoft
-  Visual C/C++ as soon as possible so that we can diagnose and fix
-  them before releasing SCons 1.3.0.
-
-- Python versions prior to 2.4 are supported by SCons 1.2.0, but are
-  officially deprecated and will generate a disableable warning message.
-  We plan to remove support for these older versions in SCons 2.0.
-  If removing this support would cause a problem for you, please contact
-  the dev@scons.tigris.org mailing list.
-
-- The following deprecated features will still be supported in 1.3.0
-  but will generate mandatory, non-disableable warnings:
-
-    --  Support for Python versions 1.5, 1.6, 2.0, 2.1, 2.2, and 2.3.
-    --  The overrides= keyword argument to the Builder() call.
-    --  The scanner= keyword argument to the Builder() call.
-    --  The BuildDir() function and env.BuildDir() method.
-    --  The env.Copy() method.
-    --  The SourceSignatures() function and
-        env.SourceSignatures() method.
-    --  The TargetSignatures() function and
-        env.TargetSignatures() method.
-    --  The Sig module (now an unnused stub).
-    --  The --debug=dtree, --debug=stree and --debug=tree options.
-    --  The --debug=nomemoizer option.
-    --  The Options object and the related BoolOption(), EnumOption(),
-        ListOption(), PackageOption() and PathOption() functions.
-
-
-WHAT'S NEW IN THIS RELEASE
-
-For a complete description of important changes since other recent
-releases, see:
-
-        http://www.scons.org/RELEASE.txt
-
-For a complete list of changes in all releases, see the official
-change log:
-
-        http://www.scons.org/CHANGES.txt
-
-We do not recommend that downstream distributions (Debian, Fedora,
-etc.) package a checkpoint release, mainly to avoid confusing the
-"public" release numbering with the long checkpoint release names.
-
-
-Here is a summary of all changes since the 1.1.0 release:
-
-
-NEW FUNCTIONALITY
-
-- SCons now supports batch compilation of Visual Studio C/C++ source
-  files when the new $MSVC_BATCH construction variable is set.
-- New reserved $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES
-  and $UNCHANGED_TARGETS variables provide finer-grained control
-  over what source or targets to pass to a command line.
-- A new batch_key= keyword argument to Action object creation supports
-  general batched builds.
-- A new --warn=future-deprecated option provides advance warnings about
-  future deprecated features that still have warnings hidden by default.
-- Visual Studio 8 project files can now be generated for 64-bit platforms.
-- Visual Studio & Visual C++ now support TARGET_OS, TARGET_ARCH for
-  cross-compiling to x86, x86_64, ia64
-
-CHANGED/ENHANCED EXISTING FUNCTIONALITY
-
-- $CCFLAGS is no longer included in the default definitions of $CXXFLAGS
-  for Visual C/C++ and MIPSpro C++ on SGI (to match other tools and
-  avoid flag duplication on C++ command lines).
-- The $CCFLAGS variable is now passed to Visual C/C++ precompiled header
-  compilation.
-- Scanning files encoded in utf-8 and utf-16 for implicit dependencies
-  is now supported.
-- Linker tools modules now differentiate properly between the SharedLibrary
-  and LoadableModule Builders.
-- Don't automatically try to build .pdf graphics files for .eps files in
-  \includegraphics{} calls in TeX/LaTeX files when building with the PDF
-  builder (and thus using pdflatex).
-- Setting WINDOWS_INSERT_DEF=0 now disables --output-def when linking
-  under MinGW.
-- AppendENVPath() and PrependENVPath() now interpret '#' in paths
-  relative to the top-level SConstruct directory.
-- The message, "scons: Build interrupted." is no printed on error output,
-  not standard output.
-- Quoted module names in SWIG source files are no handled correctly.
-- Suffix-matching for scanners is now case-insensitive on Windows.
-- Generated Visual Studio 8 project files now work better with
-  IntelliSense, by defining IncludeSearchPath and PreprocessorDefinitions.
-- Unnecessary nested $( $) strings around $_LIBDIRFLAGS have been removed
-  from the default command lines for the Microsoft linker, the OS/2
-  ilink linker and the Phar Lap linkloc linker.
-- SCons now internally spells the Windows environment variables
-  "SystemDrive" and "SystemRoot" (instead of "SYSTEMDRIVE" and
-  "SYSTEMROOT.")
-- Major revamp of Visual Studio/Visual C++ logic for locating and
-  configuring available version on the machine.
-
-FIXES
-
-- The $CHANGED_SOURCES variable now correctly includes files whose
-  corresponding targets don't exist.
-- The $CHANGED_SOURCES variable now works correctly with the
-  --config=force option.
-- $SOURCE and $SOURCES attributes now work even when there are no
-  sources specified in the Builder call.
-- $SWIGOUTDIR values with spaces now work properly.
-- Fix use of $SWIGOUTDIR when generating Python wrappers.
-- Add $SWIGDIRECTORSUFFIX and $SWIGVERSION construction variables.
-- The Borland ilink linker now uses the -e option to specify the output
-  file name.
-- SCons now correctly identifies shared libraries and shared object files
-  in a Repository.
-- Implicit command dependencies are detected even when the first argument
-  is quoted on the command line.
-- #include file names that contain escaped backslashes (\\) are now
-  handled correctly.
-- Have AddOption() remove variables from the list of
-  seen-but-unknown variables (which are reported later).
-- An option name and aliases can now be specified as a tuple.
-- Textfile builder.
-- Fix the -n option when used with VariantDir(duplicate=1)
-  and the variant directory doesn't already exist.
-- Fix scanning of Unicode files for both UTF-16 endian flavors.
-- Fix a TypeError on #include of file names with Unicode characters.
-- Fix an exception if a null command-line argument is passed in.
-- Evaluate Requires() prerequisites before a Node's direct children
-  (sources and dependencies).
-- Remove redundant __metaclass__ initializations in Environment.py.
-- Fix SWIG testing infrastructure to work on Mac OS X.
-- Substfile builder.
-- When reporting a target that SCons doesn't know how to make,
-  specify whether it's a File, Dir, etc.
-- Add -recorder flag to Latex commands and updated internals to
-  use the output to find files TeX creates. This allows the MiKTeX
-  installations to find the created files
-- Notify user of Latex errors that would get buried in the
-  Latex output
-- Remove LATEXSUFFIXES from environments that don't initialize Tex.
-- Add support for the glosaaries package for glossaries and acronyms
-- Fix problem that pdftex, latex, and pdflatex tools by themselves did
-  not create the actions for bibtex, makeindex,... by creating them
-  and other environment settings in one routine called by all four
-  tex tools.
-- Fix problem with filenames of sideeffects when the user changes
-  the name of the output file from the latex default
-
-
-
-
-DOCUMENTATION
-
-- The TestCommon.shobj_prefix variable is now documented.
-- Document that the msvc Tool module uses $PCH, $PCHSTOP and $PDB.
-- The User's Guide has had numerous typos fixed and other corrections.
-- Document that filenames with '.' as the first character are
-  ignored by Glob() by default (matching UNIX glob semantics).
-- Correct the documentation of text returned by sconf.Result().
-
-
-Thanks to Stanislav Baranov, David Cornapeau, Robert P.J. Day, 
-Lukas Erlinghagen, Allan Erskine, Hartmut Goebel, Jared Grubb, 
-Mateusz Gruca, Jim Hunziker, Ted Johnson, Jason Kenney, Steven Knight, 
-Arve Knudsen, Rob Managan, Greg Noel, Gary Oberbrunner, Zia Sobhani, 
-Greg Spencer, Roberto de Vecchi, Ben Webb and Matthew Wesley, 
-Steven Knight for their contributions to this release.
-
-
-On behalf of the SCons team,
-
-        --WPD
         res = "\n".join(res)
     s = "^" + res + "$"
     try:
+        #print 'DEBUG: lines', lines
+        #print 'DEBUG: dotall', s
         expr = re.compile(s, re.DOTALL)
     except re.error, e:
         msg = "Regular expression error in %s: %s"
         raise re.error(msg % (repr(s), e[0]))
-    if expr.match(lines):
-        return 1
+    return expr.match(lines)
 
 try:
     import difflib
         prepended unless it is enclosed in a [list].
         """
         cmd = self.command_args(program, interpreter, arguments)
-        cmd_string = ' '.join(map(self.escape, cmd))
+        #print 'DEBUG: SCONSFLAGS:', os.environ.get('SCONSFLAGS')
+        #print 'DEBUG: command line:', ' '.join(map(self.escape, cmd))
         if self.verbose:
+            cmd_string = ' '.join(map(self.escape, cmd))
             sys.stderr.write(cmd_string + "\n")
         if universal_newlines is None:
             universal_newlines = self.universal_newlines
     def _status(self):
         return self.status
 
+def _options_arguments(options, arguments):
+    """
+    This handles the "options" keyword argument and merges it
+    with the arguments.
+    """
+    if options:
+        if arguments is None:
+            arguments = options
+        else:
+            if isinstance(options, str):
+                options = [options]
+            if isinstance(arguments, str):
+                arguments = [arguments]
+            arguments = ' '.join(options + arguments)
+    return arguments
+
 class TestCommon(TestCmd):
 
     # Additional methods from the Perl Test::Cmd::Common module
             print self.banner('STDERR ')
             print actual_stderr
             self.fail_test()
-        if not expected_stdout is None and not match(actual_stdout, expected_stdout):
+        if expected_stdout is not None \
+                and not match(actual_stdout, expected_stdout):
             self.diff(expected_stdout, actual_stdout, 'STDOUT ')
             if actual_stderr:
                 print self.banner('STDERR ')
                 print actual_stderr
             self.fail_test()
-        if not expected_stderr is None and not match(actual_stderr, expected_stderr):
+        if expected_stderr is not None \
+                and not match(actual_stderr, expected_stderr):
             print self.banner('STDOUT ')
             print actual_stdout
             self.diff(expected_stderr, actual_stderr, 'STDERR ')
 
     def start(self, program = None,
                     interpreter = None,
+                    options = None,
                     arguments = None,
                     universal_newlines = None,
                     **kw):
         """
-        Starts a program or script for the test environment.
-
-        This handles the "options" keyword argument and exceptions.
+        Starts a program or script for the test environment, handling
+        any exceptions.
         """
+        arguments = _options_arguments(options, arguments)
         try:
-            options = kw['options']
-            del kw['options']
-        except KeyError:
-            pass
-        else:
-            if options:
-                if arguments is None:
-                    arguments = options
-                else:
-                    arguments = options + " " + arguments
-        try:
-            return TestCmd.start(self, program, interpreter, arguments, universal_newlines,
-                         **kw)
+            return TestCmd.start(self, program, interpreter, arguments,
+                                       universal_newlines, **kw)
         except KeyboardInterrupt:
             raise
         except Exception, e:
                   stdout = None, stderr = '', status = 0, **kw):
         """Runs the program under test, checking that the test succeeded.
 
-        The arguments are the same as the base TestCmd.run() method,
+        The parameters are the same as the base TestCmd.run() method,
         with the addition of:
 
                 options Extra options that get appended to the beginning
         not test standard output (stdout = None), and expects that error
         output is empty (stderr = "").
         """
-        if options:
-            if arguments is None:
-                arguments = options
-            else:
-                arguments = options + " " + arguments
-        kw['arguments'] = arguments
+        kw['arguments'] = _options_arguments(options, arguments)
         try:
             match = kw['match']
             del kw['match']
     fortran_lib = gccFortranLibs()
 
 
-
-file_expr = r"""File "[^"]*", line \d+, in .+
+file_expr = r"""File "[^"]*", line \d+, in [^\n]+
 """
 
 # re.escape escapes too much.
     return str
 
 
-
-try:
-    sys.version_info
-except AttributeError:
-    # Pre-1.6 Python has no sys.version_info
-    version_string = sys.version.split()[0]
-    version_ints = list(map(int, version_string.split('.')))
-    sys.version_info = tuple(version_ints + ['final', 0])
-
 def python_version_string():
     return sys.version.split()[0]
 
     return sys.version[:3]
 
 def unsupported_python_version(version=sys.version_info):
-    return version < (1, 5, 2)
+    return version < (2, 3, 0)
 
 def deprecated_python_version(version=sys.version_info):
     return version < (2, 4, 0)
     deprecated_python_expr = ""
 
 
+def initialize_sconsflags(ignore_python_version):
+    """
+    Add the --warn=no-python-version option to SCONSFLAGS for every
+    command so test scripts don't have to filter out Python version
+    deprecation warnings.
+    Same for --warn=no-visual-c-missing.
+    """
+    save_sconsflags = os.environ.get('SCONSFLAGS')
+    if save_sconsflags:
+        sconsflags = [save_sconsflags]
+    else:
+        sconsflags = []
+    if ignore_python_version and deprecated_python_version():
+        sconsflags.append('--warn=no-python-version')
+    # Provide a way to suppress or provide alternate flags for
+    # TestSCons purposes by setting TESTSCONS_SCONSFLAGS.
+    # (The intended use case is to set it to null when running
+    # timing tests of earlier versions of SCons which don't
+    # support the --warn=no-visual-c-missing warning.)
+    visual_c = os.environ.get('TESTSCONS_SCONSFLAGS',
+                              '--warn=no-visual-c-missing')
+    if visual_c:
+        sconsflags.append(visual_c)
+    os.environ['SCONSFLAGS'] = ' '.join(sconsflags)
+    return save_sconsflags
+
+def restore_sconsflags(sconsflags):
+    if sconsflags is None:
+        del os.environ['SCONSFLAGS']
+    else:
+        os.environ['SCONSFLAGS'] = sconsflags
+
 
 class TestSCons(TestCommon):
     """Class for testing SCons.
         # TERM can cause test failures due to control chars in prompts etc.
         os.environ['TERM'] = 'dumb'
         
-        self.ignore_python_version=kw.get('ignore_python_version',1)
-        if kw.get('ignore_python_version',-1) != -1:
+        self.ignore_python_version = kw.get('ignore_python_version',1)
+        if kw.get('ignore_python_version', -1) != -1:
             del kw['ignore_python_version']
 
-        if self.ignore_python_version and deprecated_python_version():
-            sconsflags = os.environ.get('SCONSFLAGS')
-            if sconsflags:
-                sconsflags = [sconsflags]
-            else:
-                sconsflags = []
-            sconsflags = sconsflags + ['--warn=no-python-version']
-            os.environ['SCONSFLAGS'] = ' '.join(sconsflags)
-
         TestCommon.__init__(self, **kw)
 
         import SCons.Node.FS
 
     def run(self, *args, **kw):
         """
-        Add the --warn=no-python-version option to SCONSFLAGS every
-        command so test scripts don't have to filter out Python version
-        deprecation warnings.
-        Same for --warn=no-visual-c-missing.
+        Set up SCONSFLAGS for every command so test scripts don't need
+        to worry about unexpected warnings in their output.
         """
-        save_sconsflags = os.environ.get('SCONSFLAGS')
-        if save_sconsflags:
-            sconsflags = [save_sconsflags]
-        else:
-            sconsflags = []
-        if self.ignore_python_version and deprecated_python_version():
-            sconsflags = sconsflags + ['--warn=no-python-version']
-        # Provide a way to suppress or provide alternate flags for
-        # TestSCons purposes by setting TESTSCONS_SCONSFLAGS.
-        # (The intended use case is to set it to null when running
-        # timing tests of earlier versions of SCons which don't
-        # support the --warn=no-visual-c-missing warning.)
-        sconsflags = sconsflags + [os.environ.get('TESTSCONS_SCONSFLAGS',
-                                                  '--warn=no-visual-c-missing')]
-        os.environ['SCONSFLAGS'] = ' '.join(sconsflags)
+        sconsflags = initialize_sconsflags(self.ignore_python_version)
         try:
-            result = TestCommon.run(self, *args, **kw)
+            TestCommon.run(self, *args, **kw)
         finally:
-            sconsflags = save_sconsflags
-        return result
+            restore_sconsflags(sconsflags)
 
-    def up_to_date(self, options = None, arguments = None, read_str = "", **kw):
+# Modifying the options should work and ought to be simpler, but this
+# class is used for more than just running 'scons' itself.  If there's
+# an automated  way of determining whether it's running 'scons' or
+# something else, this code should be resurected.
+#        options = kw.get('options')
+#        if options:
+#            options = [options]
+#        else:
+#            options = []
+#        if self.ignore_python_version and deprecated_python_version():
+#            options.append('--warn=no-python-version')
+#        # Provide a way to suppress or provide alternate flags for
+#        # TestSCons purposes by setting TESTSCONS_SCONSFLAGS.
+#        # (The intended use case is to set it to null when running
+#        # timing tests of earlier versions of SCons which don't
+#        # support the --warn=no-visual-c-missing warning.)
+#        visual_c = os.environ.get('TESTSCONS_SCONSFLAGS',
+#                                      '--warn=no-visual-c-missing')
+#        if visual_c:
+#            options.append(visual_c)
+#        kw['options'] = ' '.join(options)
+#        TestCommon.run(self, *args, **kw)
+
+    def up_to_date(self, arguments = '.', read_str = "", **kw):
         s = ""
         for arg in arguments.split():
             s = s + "scons: `%s' is up to date.\n" % arg
-            if options:
-                arguments = options + " " + arguments
         kw['arguments'] = arguments
         stdout = self.wrap_stdout(read_str = read_str, build_str = s)
         # Append '.*' so that timing output that comes after the
         kw['match'] = self.match_re_dotall
         self.run(**kw)
 
-    def not_up_to_date(self, options = None, arguments = None, **kw):
+    def not_up_to_date(self, arguments = '.', **kw):
         """Asserts that none of the targets listed in arguments is
         up to date, but does not make any assumptions on other targets.
         This function is most useful in conjunction with the -n option.
         s = ""
         for arg in arguments.split():
             s = s + "(?!scons: `%s' is up to date.)" % re.escape(arg)
-            if options:
-                arguments = options + " " + arguments
         s = '('+s+'[^\n]*\n)*'
         kw['arguments'] = arguments
         stdout = re.escape(self.wrap_stdout(build_str='ARGUMENTSGOHERE'))
 
         # warning enabled, should get expected output
         stderr = '\nscons: warning: ' + re_escape(msg) + '\n' + file_expr
-        self.run(arguments = '--warn=%s .' % warn, stderr=stderr)
+        self.run(arguments = '--warn=%s .' % warn,
+                 stderr=stderr,
+                 match = match_re_dotall)
 
         # no --warn option, should get either nothing or expected output
         expect = """()|(%s)""" % (stderr)
-        self.run(arguments = '--warn=no-%s .' % warn, stderr=expect)
+        self.run(arguments = '--warn=no-%s .' % warn,
+                 stderr=expect,
+                 match = match_re_dotall)
 
         # warning disabled, should get either nothing or mandatory message
         expect = """()|(Can not disable mandataory warning: 'no-%s'\n\n%s)""" % (warn, stderr)
-        self.run(arguments = '--warn=no-%s .' % warn, stderr=expect)
+        self.run(arguments = '--warn=no-%s .' % warn,
+                 stderr=expect,
+                 match = match_re_dotall)
 
     def diff_substr(self, expect, actual, prelen=20, postlen=40):
         i = 0
         s = re.sub(r'/Length \d+ *\n/Filter /FlateDecode\n',
                    r'/Length XXXX\n/Filter /FlateDecode\n', s)
 
-
         try:
             import zlib
         except ImportError:
         """
         if 'stdin' not in kw:
             kw['stdin'] = True
-        return TestCommon.start(self, *args, **kw)
+        sconsflags = initialize_sconsflags(self.ignore_python_version)
+        try:
+            p = TestCommon.start(self, *args, **kw)
+        finally:
+            restore_sconsflags(sconsflags)
+        return p
 
     def wait_for(self, fname, timeout=10.0, popen=None):
         """
 
     - Add a '-3' option to runtest to print 3.x incompatibility warnings.
 
-    - Convert most old-style classes into new-style classes.
-
-    - Update deprecation warnings; most now become errors.
+    - Convert old-style classes into new-style classes.
 
   From Greg Noel:
 
 
     - Comb out code paths specialized to Pythons older than 2.4.
 
+    - Update deprecation warnings; most now become mandatory.
+
+    - Start deprecation cycle for BuildDir() and build_dir.
+
 
 RELEASE 1.3.0 - Tue, 23 Mar 2010 21:44:19 -0400
 
-  A new SCons checkpoint release, 2.0.0.alpha.20100508, is now available.
-  The primary purpose of this release is to remove support for
-  Python versions prior to 2.4 and streamline the SCons code base
-  using more modern python idioms.
-  The checkpoint is available at the SCons download page:
+  A new SCons checkpoint release, 2.0.0.beta.yyyymmdd, is now available on
+  the SCons download page:
 
           http://www.scons.org/download.php
 
+  The primary purpose of this release is to remove support for Python
+  versions prior to 2.4 and streamline the SCons code base using more
+  modern python idioms.
+
   A SCons "checkpoint release" is intended to provide early access to
   new features so they can be tested in the field before being released
   for adoption by other software distributions.
   - All features or usages deprecated in 1.3 should have been removed.
     Uses of formerly-deprecated features should get an error.
 
+  - The BuildDir() method and the build_dir option now get warnings.
+
   CHANGED/ENHANCED EXISTING FUNCTIONALITY
 
   - Any Command() or env.Command() calls that use the following Action
   DEVELOPMENT
 
   - Code no longer has to be compatible with Python versions back to 1.5.2.
+    Although code is tested with Python 2.3 and is still believed to work,
+    the official new floor is Python 2.4.
 
   Thanks to Greg Noel and Steven Knight for their contributions to this
   release.

src/engine/SCons/Environment.py

         return tlist
 
     def BuildDir(self, *args, **kw):
+        msg = """BuildDir() and the build_dir keyword have been deprecated;\n\tuse VariantDir() and the variant_dir keyword instead."""
+        SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)
         if 'build_dir' in kw:
             kw['variant_dir'] = kw['build_dir']
             del kw['build_dir']
 
     def SourceCode(self, entry, builder):
         """Arrange for a source code builder for (part of) a tree."""
+        #msg = """SourceCode() has been deprecated and there is no replacement.
+#\tIf you need this function, please contact dev@scons.tigris.org."""
+        #SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)
         entries = self.arg2nodes(entry, self.fs.Entry)
         for entry in entries:
             entry.set_src_builder(builder)

src/engine/SCons/Script/Main.py

     # suppress) appropriate warnings about anything that might happen,
     # as configured by the user.
 
-    default_warnings = [ SCons.Warnings.CorruptSConsignWarning,
+    default_warnings = [ SCons.Warnings.WarningOnByDefault,
                          SCons.Warnings.DeprecatedWarning,
-                         SCons.Warnings.DuplicateEnvironmentWarning,
-                         SCons.Warnings.FutureReservedVariableWarning,
-                         SCons.Warnings.LinkWarning,
-                         SCons.Warnings.MissingSConscriptWarning,
-                         SCons.Warnings.NoMD5ModuleWarning,
-                         SCons.Warnings.NoMetaclassSupportWarning,
-                         SCons.Warnings.NoObjectCountWarning,
-                         SCons.Warnings.NoParallelSupportWarning,
-                         SCons.Warnings.MisleadingKeywordsWarning,
-                         SCons.Warnings.ReservedVariableWarning,
-                         SCons.Warnings.StackSizeWarning,
-                         SCons.Warnings.VisualVersionMismatch,
-                         SCons.Warnings.VisualCMissingWarning,
                        ]
 
     for warning in default_warnings:
     # $SCONSFLAGS, or in the SConscript file, then the search through
     # the list of deprecated warning classes will find that disabling
     # first and not issue the warning.
-    SCons.Warnings.enableWarningClass(SCons.Warnings.PythonVersionWarning)
+    #SCons.Warnings.enableWarningClass(SCons.Warnings.PythonVersionWarning)
     SCons.Warnings.process_warn_strings(options.warn)
 
     # Now that we've read the SConscript files, we can check for the

src/engine/SCons/Script/SConscript.py

 
     def _get_SConscript_filenames(self, ls, kw):
         """
-        Convert the parameters passed to # SConscript() calls into a list
+        Convert the parameters passed to SConscript() calls into a list
         of files and export variables.  If the parameters are invalid,
         throws SCons.Errors.UserError. Returns a tuple (l, e) where l
         is a list of SConscript filenames and e is a list of exports.
             raise SCons.Errors.UserError("Import of non-existent variable '%s'"%x)
 
     def SConscript(self, *ls, **kw):
+        if 'build_dir' in kw:
+            msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead."""
+            SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg)
         def subst_element(x, subst=self.subst):
             if SCons.Util.is_List(x):
                 x = list(map(subst, x))

src/engine/SCons/Warnings.py

 class Warning(SCons.Errors.UserError):
     pass
 
+class WarningOnByDefault(Warning):
+    pass
 
 
 # NOTE:  If you add a new warning class, add it to the man page, too!
 class CacheWriteErrorWarning(Warning):
     pass
 
-class CorruptSConsignWarning(Warning):
+class CorruptSConsignWarning(WarningOnByDefault):
     pass
 
 class DependencyWarning(Warning):
     pass
 
-class DuplicateEnvironmentWarning(Warning):
+class DuplicateEnvironmentWarning(WarningOnByDefault):
     pass
 
-class FutureReservedVariableWarning(Warning):
+class FutureReservedVariableWarning(WarningOnByDefault):
     pass
 
-class LinkWarning(Warning):
+class LinkWarning(WarningOnByDefault):
     pass
 
-class MisleadingKeywordsWarning(Warning):
+class MisleadingKeywordsWarning(WarningOnByDefault):
     pass
 
-class MissingSConscriptWarning(Warning):
+class MissingSConscriptWarning(WarningOnByDefault):
     pass
 
-class NoMD5ModuleWarning(Warning):
+class NoMD5ModuleWarning(WarningOnByDefault):
     pass
 
-class NoMetaclassSupportWarning(Warning):
+class NoMetaclassSupportWarning(WarningOnByDefault):
     pass
 
-class NoObjectCountWarning(Warning):
+class NoObjectCountWarning(WarningOnByDefault):
     pass
 
-class NoParallelSupportWarning(Warning):
+class NoParallelSupportWarning(WarningOnByDefault):
     pass
 
-class ReservedVariableWarning(Warning):
+class ReservedVariableWarning(WarningOnByDefault):
     pass
 
-class StackSizeWarning(Warning):
+class StackSizeWarning(WarningOnByDefault):
     pass
 
-class VisualCMissingWarning(Warning):
+class VisualCMissingWarning(WarningOnByDefault):
     pass
 
 # Used when MSVC_VERSION and MSVS_VERSION do not point to the
 # same version (MSVS_VERSION is deprecated)
-class VisualVersionMismatch(Warning):
+class VisualVersionMismatch(WarningOnByDefault):
     pass
 
 class VisualStudioMissingWarning(Warning):
     pass
 
 
+# Special case; base always stays DeprecatedWarning
 class PythonVersionWarning(DeprecatedWarning):
     pass
 
+class DeprecatedSourceCodeWarning(FutureDeprecatedWarning):
+    pass
+
+class DeprecatedBuildDirWarning(DeprecatedWarning):
+    pass
+
+class TaskmasterNeedsExecuteWarning(DeprecatedWarning):
+    pass
+
 class DeprecatedCopyWarning(MandatoryDeprecatedWarning):
     pass
 
 class DeprecatedTargetSignaturesWarning(MandatoryDeprecatedWarning):
     pass
 
-class TaskmasterNeedsExecuteWarning(DeprecatedWarning):
-    pass
-
 class DeprecatedDebugOptionsWarning(MandatoryDeprecatedWarning):
     pass
 
     _enabled.insert(0, (clazz, 0))
 
 def enableWarningClass(clazz):
-    """Enable all warnings that are of type clazz or
+    """Enables all warnings that are of type clazz or
     derived from clazz."""
     _enabled.insert(0, (clazz, 1))
 

test/CPPPATH/subdir-as-include.py

 env.Program('prog.cpp')
 
 Export('env')
-SConscript('inc1/SConscript', build_dir='inc1/build', duplicate=0)
+SConscript('inc1/SConscript', variant_dir='inc1/build', duplicate=0)
 """)
 
 test.write('prog.cpp', """\

test/Configure/VariantDir2.py

 test = TestSCons.TestSCons()
 
 test.write('SConstruct', """\
-SConscript('SConscript', build_dir='build', src='.')
+SConscript('SConscript', variant_dir='build', src='.')
 """)
 
 test.write('SConscript', """\

test/Deprecated/BuildDir.py

 Verify that the deprecated BuildDir() function and method still
 work to create a variant directory tree (by calling VariantDir()
 under the covers).
-
-Note that using BuildDir() does not yet print a deprecation warning.
 """
 
 import TestSCons
 
 test = TestSCons.TestSCons()
 
+test.write('SConstruct', """
+BuildDir('build', 'src')
+""")
+
+msg = """BuildDir() and the build_dir keyword have been deprecated;
+\tuse VariantDir() and the variant_dir keyword instead."""
+test.deprecated_warning('deprecated-build-dir', msg)
+
+warning = '\nscons: warning: ' + TestSCons.re_escape(msg) \
+                               + '\n' + TestSCons.file_expr
+
 foo11 = test.workpath('work1', 'build', 'var1', 'foo1' + _exe)
 foo12 = test.workpath('work1', 'build', 'var1', 'foo2' + _exe)
 foo21 = test.workpath('work1', 'build', 'var2', 'foo1' + _exe)
 test.subdir('work1')
 
 test.write(['work1', 'SConstruct'], """
+SetOption('warn', 'deprecated-build-dir')
 src = Dir('src')
 var2 = Dir('build/var2')
 var3 = Dir('build/var3')
 
 env = Environment(BUILD = 'build', SRC = 'src')
 
-VariantDir('build/var1', src)
-VariantDir(var2, src)
-VariantDir(var3, src, duplicate=0)
-env.VariantDir("$BUILD/var4", "$SRC", duplicate=0)
-VariantDir(var5, src, duplicate=0)
-VariantDir(var6, src)
+BuildDir('build/var1', src)
+BuildDir(var2, src)
+BuildDir(var3, src, duplicate=0)
+env.BuildDir("$BUILD/var4", "$SRC", duplicate=0)
+BuildDir(var5, src, duplicate=0)
+BuildDir(var6, src)
 
 env = Environment(CPPPATH='#src', FORTRANPATH='#src')
 SConscript('build/var1/SConscript', "env")
 # Some releases of freeBSD seem to have library complaints about
 # tempnam().  Filter out these annoying messages before checking for
 # error output.
-def blank_output(err):
+def filter_tempnam(err):
     if not err:
-        return 1
-    stderrlines = [l for l in err.split('\n') if l]
+        return ''
     msg = "warning: tempnam() possibly used unsafely"
-    stderrlines = [l for l in stderrlines if l.find(msg) == -1]
-    return len(stderrlines) == 0
+    return '\n'.join([l for l in err.splitlines() if l.find(msg) == -1])
 
 test.run(chdir='work1', arguments = '. ../build', stderr=None)
 
-test.fail_test(not blank_output(test.stderr()))
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
 
 test.run(program = foo11, stdout = "f1.c\n")
 test.run(program = foo12, stdout = "f2.c\n")
 test.run(program = foo41, stdout = "f1.c\n")
 test.run(program = foo42, stdout = "f2.c\n")
 
-test.run(chdir='work1', arguments='. ../build', stdout=test.wrap_stdout("""\
+test.run(chdir='work1',
+         arguments='. ../build',
+         stderr = None,
+         stdout=test.wrap_stdout("""\
 scons: `.' is up to date.
 scons: `%s' is up to date.
 """ % test.workpath('build')))
 
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
+
 import os
 import stat
 def equal_stats(x,y):
 
 test.run(chdir='work1', arguments = '../build/var5', stderr=None)
 
-test.fail_test(not blank_output(test.stderr()))
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
 
 test.run(program = foo51, stdout = "f1.c 2\n")
 test.run(program = test.workpath('build', 'var5', 'foo3' + _exe),
 test.run(program = test.workpath('build', 'var5', 'foo4' + _exe),
                                  stdout = "f4.c 2\n")
 
-test.run(chdir='work1', arguments='../build/var5', stdout=test.wrap_stdout("""\
+test.run(chdir='work1',
+         arguments='../build/var5',
+         stderr=None,
+         stdout=test.wrap_stdout("""\
 scons: `%s' is up to date.
 """ % test.workpath('build', 'var5')))
 
+stderr = filter_tempnam(test.stderr())
+test.fail_test(TestSCons.match_re_dotall(stderr, 6*warning))
+
 test.pass_test()
 
 # Local Variables:

test/Deprecated/Options/BoolOption.py

     assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
 
 
-
 test.write(SConstruct_path, """\
+SetOption('warn', 'deprecated-options')
 from SCons.Options.BoolOption import BoolOption
 BO = BoolOption
 
 test.run(arguments='warnings=irgendwas', stderr=expect_stderr, status=2)
 
 
-
 test.pass_test()
 
 # Local Variables:

test/Deprecated/SConscript-build_dir.py

 
 """
 Verify that specifying a build_dir argument to SConscript still works.
-
-Note that the build_dir argument does not yet print a deprecation warning.
 """
 
 import TestSCons
 
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
+
+test.write('SConstruct', """
+SConscript('SConscript', build_dir = 'build')
+""")
+
+test.write('SConscript', """
+""")
+
+msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead."""
+test.deprecated_warning('deprecated-build-dir', msg)
+
+warning = '\nscons: warning: ' + TestSCons.re_escape(msg) \
+                               + '\n' + TestSCons.file_expr
 
 all1 = test.workpath('test', 'build', 'var1', 'all')
 all2 = test.workpath('test', 'build', 'var2', 'all')
 test.subdir('test')
 
 test.write(['test', 'SConstruct'], """
+SetOption('warn', 'deprecated-build-dir')
 src = Dir('src')
 alt = Dir('alt')
 var1 = Dir('build/var1')
 test.write('test/alt/bbb.in', "test/alt/bbb.in\n")
 test.write('test/alt/ccc.in', "test/alt/ccc.in\n")
 
-test.run(chdir='test', arguments = '. ../build')
+test.run(chdir='test', arguments = '. ../build', stderr = 7*warning)
 
 all_src = "test/src/aaa.in\ntest/src/bbb.in\ntest/src/ccc.in\n"
 all_alt = "test/alt/aaa.in\ntest/alt/bbb.in\ntest/alt/ccc.in\n"
 }
 """)
 
-test.run(chdir="test2")
+test.run(chdir="test2", stderr = warning)
 
 _obj = TestSCons._obj
 
 
 test.write(['test3', 'src', '_glscry', 'file.in'], "file.in\n")
 
-test.run(chdir='test3')
+test.run(chdir='test3', stderr = warning)
 
 
 test.pass_test()

test/Deprecated/Sig.py

+#!/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 we generate the proper warning, but don't die, when someone
+tries to import the SCons.Sig module (which no longer exists) and
+use the things we used to define therein.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+SConstruct = test.workpath('SConstruct')
+
+test.write(SConstruct, """
+import SCons.Sig
+x = SCons.Sig.default_calc
+x = SCons.Sig.default_module
+x = SCons.Sig.MD5.current()
+x = SCons.Sig.MD5.collect()
+x = SCons.Sig.MD5.signature()
+x = SCons.Sig.MD5.to_string()
+x = SCons.Sig.MD5.from_string()
+x = SCons.Sig.TimeStamp.current()
+x = SCons.Sig.TimeStamp.collect()
+x = SCons.Sig.TimeStamp.signature()
+x = SCons.Sig.TimeStamp.to_string()
+x = SCons.Sig.TimeStamp.from_string()
+""")
+
+expect = """
+scons: warning: The SCons.Sig module no longer exists.
+    Remove the following "import SCons.Sig" line to eliminate this warning:
+""" + test.python_file_line(SConstruct, 2)
+
+test.run(arguments = '.', stderr=expect)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:

test/Deprecated/SourceSignatures/basic.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.SourceSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 write_SConstruct(test, 'timestamp')
 

test/Deprecated/SourceSignatures/env.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.SourceSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 
 write_SConstruct(test, 'MD5', 'timestamp')

test/Deprecated/SourceSignatures/implicit-cache.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.SourceSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 
 both_out_both_in = re.escape(test.wrap_stdout('build(["both.out"], ["both.in"])\n'))

test/Deprecated/SourceSignatures/no-csigs.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.SourceSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 test.run(arguments = '.', stderr = expect)
 

test/Deprecated/SourceSignatures/overrides.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.SourceSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 test.write('SConstruct', """\
 SetOption('warn', 'deprecated-source-signatures')

test/Deprecated/SourceSignatures/switch-rebuild.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.SourceSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 
 base_sconstruct_contents = """\

test/Deprecated/TargetSignatures/build-content.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.TargetSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 
 sconstruct_contents = """\

test/Deprecated/TargetSignatures/content.py

 """) + TestSCons.file_expr + TestSCons.re_escape("""
 scons: warning: The env.TargetSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 
 test.write('SConstruct', """\

test/Deprecated/TargetSignatures/overrides.py

 expect = TestSCons.re_escape("""
 scons: warning: The env.TargetSignatures() method is deprecated;
 \tconvert your build to use the env.Decider() method instead.
-""") + TestSCons.file_expr + TestSCons.deprecated_python_expr
+""") + TestSCons.file_expr
 
 test.run(arguments = '.', stderr = expect)
 
 #/SConstruct ------------------------------------------
 import os
 env = Environment(ENV = os.environ)
-BuildDir('build', 'sub1', duplicate=0)
+VariantDir('build', 'sub1', duplicate=0)
 base = '#build/sub1'
 Export('env base')
 SConscript('sub1/SConscript', exports='env')

test/Sig.py

-#!/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 we generate the proper warning, but don't die, when someone
-tries to import the SCons.Sig module (which no longer exists) and
-use the things we used to define therein.
-"""
-
-import TestSCons
-
-test = TestSCons.TestSCons()
-
-SConstruct = test.workpath('SConstruct')
-
-test.write(SConstruct, """
-import SCons.Sig
-x = SCons.Sig.default_calc
-x = SCons.Sig.default_module
-x = SCons.Sig.MD5.current()
-x = SCons.Sig.MD5.collect()
-x = SCons.Sig.MD5.signature()
-x = SCons.Sig.MD5.to_string()
-x = SCons.Sig.MD5.from_string()
-x = SCons.Sig.TimeStamp.current()
-x = SCons.Sig.TimeStamp.collect()
-x = SCons.Sig.TimeStamp.signature()
-x = SCons.Sig.TimeStamp.to_string()
-x = SCons.Sig.TimeStamp.from_string()
-""")
-
-expect = """
-scons: warning: The SCons.Sig module no longer exists.
-    Remove the following "import SCons.Sig" line to eliminate this warning:
-""" + test.python_file_line(SConstruct, 2)
-
-test.run(arguments = '.', stderr=expect)
-
-test.pass_test()
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
     #" <- unconfuses emacs syntax highlighting
 
     test.must_contain_all_lines(test.stdout(), [out1, out2, out7, out8])
-    print test.stdout()
+    #print test.stdout()
     test.fail_test(re.search(out3, test.stdout()) == None)
 
     test.must_match('f1.out', "/usr/local")
 
     test.up_to_date(arguments='.')
 
-    test.run(arguments='prefix=/usr')
+    test.run(options='prefix=/usr')
     out4 = """create(["f1.out"], ['/usr'])"""
     out5 = """create(["f2.out"], [4])"""
     out6 = """create\\(\\["f3.out"\\], \\[<.*.Custom (instance|object) at """
     test.must_match('f3.out', "C=/usr")
     test.must_match('f4.out', '4')
 
-    test.up_to_date('prefix=/usr', '.')
+    test.up_to_date(options='prefix=/usr', arguments='.')
 
     test.unlink('f3.out')
 
-    test.run(arguments='prefix=/var')
+    test.run(options='prefix=/var')
     out4 = """create(["f1.out"], ['/var'])"""
 
     test.must_contain_all_lines(test.stdout(), [out4, out7, out8])
     test.must_not_contain_any_line(test.stdout(), [out5])
     test.fail_test(re.search(out6, test.stdout()) == None)
 
-    test.up_to_date('prefix=/var', '.')
+    test.up_to_date(options='prefix=/var', arguments='.')
 
     test.must_match('f1.out', "/var")
     test.must_match('f2.out', "4")

test/option/warn-dependency.py

 test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
 
 
-
 test.write("SConstruct", """\
 import SCons.Defaults
 
 """)
 
 
-
 expect = r"""
 scons: warning: No dependency generated for file: not_there\.h \(included from: foo\.c\) \-\- file not found
-"""
+""" + TestSCons.file_expr
 
 test.run(arguments='--warn=dependency .',
-         stderr=expect + TestSCons.file_expr)
+         stderr=expect)
 
 test.run(arguments='--warn=dependency .',
-         stderr=expect + TestSCons.file_expr)
+         stderr=expect)
 
 test.run(arguments='--warn=all --warn=no-dependency .',
          stderr=TestSCons.deprecated_python_expr)
 
 test.run(arguments='--warn=no-dependency --warn=all .',
-         stderr=TestSCons.deprecated_python_expr + expect + TestSCons.file_expr)
-
+         stderr=TestSCons.deprecated_python_expr + expect)
 
 
 test.pass_test()

test/option/warn-duplicate-environment.py

 test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
 
 
-
 test.write('SConstruct', """
 def build(env, target, source):
     file = open(str(target[0]), 'wb')
 expect = r"""
 scons: warning: Two different environments were specified for target file1.out,
 \tbut they appear to have the same action: build\(target, source, env\)
-"""
+""" + TestSCons.file_expr
 
-test.run(arguments='file1.out', 
-         stderr=expect + TestSCons.file_expr)
+test.run(arguments='file1.out', stderr=expect)
 
 test.must_match('file1.out', "file1a.in\nfile1b.in\n")
 
-test.run(arguments='--warn=duplicate-environment file1.out', 
-         stderr=expect + TestSCons.file_expr)
+test.run(arguments='--warn=duplicate-environment file1.out', stderr=expect)
 
 test.run(arguments='--warn=no-duplicate-environment file1.out')
 
-test.run(arguments='WARN=duplicate-environment file1.out', 
-         stderr=expect + TestSCons.file_expr)
+test.run(arguments='WARN=duplicate-environment file1.out', stderr=expect)
 
-test.run(arguments='WARN=no-duplicate-environment file1.out',
-         stderr = TestSCons.deprecated_python_expr)
-
+test.run(arguments='WARN=no-duplicate-environment file1.out')
 
 
 test.pass_test()

test/option/warn-misleading-keywords.py

 test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
 
 
-
 test.write('SConstruct', """
 def build(env, target, source):
     file = open(str(target[0]), 'wb')
 
 expect = r"""
 scons: warning: Did you mean to use `(target|source)' instead of `(targets|sources)'\?
-"""
+""" + TestSCons.file_expr
 
 test.run(arguments='.', 
-         stderr=expect + TestSCons.file_expr + expect + TestSCons.file_expr)
+         stderr=expect + expect)
 
 test.must_match(['file3a'], 'file3a.in\n')
 test.must_match(['file3b'], 'file3b.out\n')
 
-test.run(arguments='--warn=misleading-keywords .', 
-         stderr=expect + TestSCons.file_expr + expect + TestSCons.file_expr)
+test.run(arguments='--warn=misleading-keywords .', stderr=expect + expect)
 
 test.run(arguments='--warn=no-misleading-keywords .')
 
-test.run(arguments='WARN=misleading-keywords .', 
-         stderr=expect + TestSCons.file_expr + expect + TestSCons.file_expr)
+test.run(arguments='WARN=misleading-keywords .', stderr=expect + expect)
 
-test.run(arguments='WARN=no-misleading-keywords .',
-         stderr = TestSCons.deprecated_python_expr)
-
+test.run(arguments='WARN=no-misleading-keywords .')
 
 
 test.pass_test()

test/option/warn-missing-sconscript.py

 test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
 
 
-
 test.write("SConstruct", """\
 def build(target, source, env):
     pass
 #include "not_there.h"
 """)
 
-test.run(arguments = '--warn=missing-sconscript .', stderr = r"""
+expect = r"""
 scons: warning: Ignoring missing SConscript 'no_such_file'
-""" + TestSCons.file_expr)
+""" + TestSCons.file_expr
+
+test.run(arguments = '--warn=missing-sconscript .', stderr = expect)
 
 test.run(arguments = '--warn=no-missing-sconscript .', stderr = "")
 
-test.run(arguments = 'WARN=missing-sconscript .', stderr = r"""
-scons: warning: Ignoring missing SConscript 'no_such_file'
-""" + TestSCons.file_expr)
+test.run(arguments = 'WARN=missing-sconscript .', stderr = expect)
 
-test.run(arguments = 'WARN=no-missing-sconscript .',
-         stderr = TestSCons.deprecated_python_expr)
-
+test.run(arguments = 'WARN=no-missing-sconscript .')
 
 
 test.pass_test()