summaryrefslogtreecommitdiff
path: root/test/Deprecated
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-12-20 16:23:36 +0000
committerSteven Knight <knight@baldmt.com>2008-12-20 16:23:36 +0000
commit71c54f6a12dae9c5494827e54259a3e34237813b (patch)
tree0d22552936968f8ef0f890a511a9b82ca3728ad4 /test/Deprecated
parent9006aefb25baa8dc13b6427ac7a9e143c56a884e (diff)
downloadscons-71c54f6a12dae9c5494827e54259a3e34237813b.tar.gz
Add warnings for use of the (already) deprecated Options object
and its related functions.
Diffstat (limited to 'test/Deprecated')
-rw-r--r--test/Deprecated/Options/BoolOption.py21
-rw-r--r--test/Deprecated/Options/EnumOption.py33
-rw-r--r--test/Deprecated/Options/ListOption.py68
-rw-r--r--test/Deprecated/Options/Options.py43
-rw-r--r--test/Deprecated/Options/PackageOption.py22
-rw-r--r--test/Deprecated/Options/PathOption.py106
-rw-r--r--test/Deprecated/Options/chdir.py8
-rw-r--r--test/Deprecated/Options/help.py45
-rw-r--r--test/Deprecated/Options/import.py10
9 files changed, 204 insertions, 152 deletions
diff --git a/test/Deprecated/Options/BoolOption.py b/test/Deprecated/Options/BoolOption.py
index d45ad1bc..99c2cd7a 100644
--- a/test/Deprecated/Options/BoolOption.py
+++ b/test/Deprecated/Options/BoolOption.py
@@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Test the BoolOption canned Option type.
"""
-import os.path
import string
try:
@@ -39,7 +38,7 @@ except NameError:
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
@@ -71,19 +70,25 @@ Default(env.Alias('dummy', None))
""")
+warnings = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+%s
+scons: warning: The BoolOption\\(\\) function is deprecated; use the BoolVariable\\(\\) function instead.
+%s""" % (TestSCons.file_expr, TestSCons.file_expr)
+
+test.run(stderr=warnings)
-test.run()
check([str(True), str(False)])
-test.run(arguments='warnings=0 profile=no profile=true')
+test.run(arguments='warnings=0 profile=no profile=true', stderr=warnings)
check([str(False), str(True)])
-expect_stderr = """
-scons: *** Error converting option: warnings
+expect_stderr = (warnings + """
+scons: \\*\\*\\* Error converting option: warnings
Invalid value for boolean option: irgendwas
-""" + test.python_file_line(SConstruct_path, 12)
+""" + TestSCons.file_expr)
-test.run(arguments='warnings=irgendwas', stderr = expect_stderr, status=2)
+test.run(arguments='warnings=irgendwas', stderr=expect_stderr, status=2)
diff --git a/test/Deprecated/Options/EnumOption.py b/test/Deprecated/Options/EnumOption.py
index 29724f3d..d46b8986 100644
--- a/test/Deprecated/Options/EnumOption.py
+++ b/test/Deprecated/Options/EnumOption.py
@@ -33,7 +33,7 @@ import string
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
@@ -75,29 +75,36 @@ Default(env.Alias('dummy', None))
""")
-test.run(); check(['no', 'gtk', 'xaver'])
-test.run(arguments='debug=yes guilib=Motif some=xAVER')
+warnings = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+%s
+scons: warning: The EnumOption\\(\\) function is deprecated; use the EnumVariable\\(\\) function instead.
+%s""" % (TestSCons.file_expr, TestSCons.file_expr)
+
+test.run(stderr=warnings); check(['no', 'gtk', 'xaver'])
+
+test.run(arguments='debug=yes guilib=Motif some=xAVER', stderr=warnings)
check(['yes', 'Motif', 'xaver'])
-test.run(arguments='debug=full guilib=KdE some=EiNs')
+test.run(arguments='debug=full guilib=KdE some=EiNs', stderr=warnings)
check(['full', 'KdE', 'eins'])
-expect_stderr = """
-scons: *** Invalid value for option debug: FULL
-""" + test.python_file_line(SConstruct_path, 21)
+expect_stderr = warnings + """
+scons: \\*\\*\\* Invalid value for option debug: FULL
+""" + TestSCons.file_expr
test.run(arguments='debug=FULL', stderr=expect_stderr, status=2)
-expect_stderr = """
-scons: *** Invalid value for option guilib: irgendwas
-""" + test.python_file_line(SConstruct_path, 21)
+expect_stderr = warnings + """
+scons: \\*\\*\\* Invalid value for option guilib: irgendwas
+""" + TestSCons.file_expr
test.run(arguments='guilib=IrGeNdwas', stderr=expect_stderr, status=2)
-expect_stderr = """
-scons: *** Invalid value for option some: irgendwas
-""" + test.python_file_line(SConstruct_path, 21)
+expect_stderr = warnings + """
+scons: \\*\\*\\* Invalid value for option some: irgendwas
+""" + TestSCons.file_expr
test.run(arguments='some=IrGeNdwas', stderr=expect_stderr, status=2)
diff --git a/test/Deprecated/Options/ListOption.py b/test/Deprecated/Options/ListOption.py
index 7e7b18fb..62792b6c 100644
--- a/test/Deprecated/Options/ListOption.py
+++ b/test/Deprecated/Options/ListOption.py
@@ -35,7 +35,7 @@ import string
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
@@ -81,7 +81,13 @@ print env.subst_path('$shared')
Default(env.Alias('dummy', None))
""")
-test.run()
+warnings = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+%s
+scons: warning: The ListOption\\(\\) function is deprecated; use the ListVariable\\(\\) function instead.
+%s""" % (TestSCons.file_expr, TestSCons.file_expr)
+
+test.run(stderr=warnings)
check(['all', '1', 'gl ical qt x11', 'gl ical qt x11',
"['gl ical qt x11']"])
@@ -91,61 +97,61 @@ test.must_match(test.workpath('scons.options'), expect)
check(['all', '1', 'gl ical qt x11', 'gl ical qt x11',
"['gl ical qt x11']"])
-test.run(arguments='shared=none')
+test.run(arguments='shared=none', stderr=warnings)
check(['none', '0', '', '', "['']"])
-test.run(arguments='shared=')
+test.run(arguments='shared=', stderr=warnings)
check(['none', '0', '', '', "['']"])
-test.run(arguments='shared=x11,ical')
+test.run(arguments='shared=x11,ical', stderr=warnings)
check(['ical,x11', '1', 'ical x11', 'ical x11',
"['ical x11']"])
-test.run(arguments='shared=x11,,ical,,')
+test.run(arguments='shared=x11,,ical,,', stderr=warnings)
check(['ical,x11', '1', 'ical x11', 'ical x11',
"['ical x11']"])
-test.run(arguments='shared=GL')
+test.run(arguments='shared=GL', stderr=warnings)
check(['gl', '0', 'gl', 'gl'])
-test.run(arguments='shared=QT,GL')
+test.run(arguments='shared=QT,GL', stderr=warnings)
check(['gl,qt', '0', 'gl qt', 'gl qt', "['gl qt']"])
-expect_stderr = """
-scons: *** Error converting option: shared
-Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 19)
+expect_stderr = warnings + """
+scons: \\*\\*\\* Error converting option: shared
+Invalid value\\(s\\) for option: foo
+""" + TestSCons.file_expr
test.run(arguments='shared=foo', stderr=expect_stderr, status=2)
# be paranoid in testing some more combinations
-expect_stderr = """
-scons: *** Error converting option: shared
-Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 19)
+expect_stderr = warnings + """
+scons: \\*\\*\\* Error converting option: shared
+Invalid value\\(s\\) for option: foo
+""" + TestSCons.file_expr
test.run(arguments='shared=foo,ical', stderr=expect_stderr, status=2)
-expect_stderr = """
-scons: *** Error converting option: shared
-Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 19)
+expect_stderr = warnings +"""
+scons: \\*\\*\\* Error converting option: shared
+Invalid value\\(s\\) for option: foo
+""" + TestSCons.file_expr
test.run(arguments='shared=ical,foo', stderr=expect_stderr, status=2)
-expect_stderr = """
-scons: *** Error converting option: shared
-Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 19)
+expect_stderr = warnings +"""
+scons: \\*\\*\\* Error converting option: shared
+Invalid value\\(s\\) for option: foo
+""" + TestSCons.file_expr
test.run(arguments='shared=ical,foo,x11', stderr=expect_stderr, status=2)
-expect_stderr = """
-scons: *** Error converting option: shared
-Invalid value(s) for option: foo,bar
-""" + test.python_file_line(SConstruct_path, 19)
+expect_stderr = warnings +"""
+scons: \\*\\*\\* Error converting option: shared
+Invalid value\\(s\\) for option: foo,bar
+""" + TestSCons.file_expr
test.run(arguments='shared=foo,x11,,,bar', stderr=expect_stderr, status=2)
@@ -169,9 +175,11 @@ print env['gpib']
Default(env.Alias('dummy', None))
""")
-test.run(stdout=test.wrap_stdout(read_str="ENET,GPIB\n", build_str="""\
+expect = test.wrap_stdout(read_str="ENET,GPIB\n", build_str="""\
scons: Nothing to be done for `dummy'.
-"""))
+""")
+
+test.run(stdout=expect, stderr=warnings)
diff --git a/test/Deprecated/Options/Options.py b/test/Deprecated/Options/Options.py
index 11452b12..1edfa97c 100644
--- a/test/Deprecated/Options/Options.py
+++ b/test/Deprecated/Options/Options.py
@@ -27,7 +27,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
import string
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
test.write('SConstruct', """
import string
@@ -127,26 +127,31 @@ Default(env.Alias('dummy', None))
""")
+warnings = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+""" + TestSCons.file_expr
+
+
def check(expect):
result = string.split(test.stdout(), '\n')
assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
-test.run()
+test.run(stderr=warnings)
check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v'])
-test.run(arguments='RELEASE_BUILD=1')
+test.run(arguments='RELEASE_BUILD=1', stderr=warnings)
check(['1', '1', cc, string.strip(ccflags + ' -O -g'), 'v', 'v'])
-test.run(arguments='RELEASE_BUILD=1 DEBUG_BUILD=0')
+test.run(arguments='RELEASE_BUILD=1 DEBUG_BUILD=0', stderr=warnings)
check(['1', '0', cc, string.strip(ccflags + ' -O'), 'v', 'v'])
-test.run(arguments='CC=not_a_c_compiler')
+test.run(arguments='CC=not_a_c_compiler', stderr=warnings)
check(['0', '1', 'not_a_c_compiler', string.strip(ccflags + ' -g'), 'v', 'v'])
-test.run(arguments='UNDECLARED=foo')
+test.run(arguments='UNDECLARED=foo', stderr=warnings)
check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v'])
-test.run(arguments='CCFLAGS=--taco')
+test.run(arguments='CCFLAGS=--taco', stderr=warnings)
check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v'])
test.write('custom.py', """
@@ -154,10 +159,10 @@ DEBUG_BUILD=0
RELEASE_BUILD=1
""")
-test.run()
+test.run(stderr=warnings)
check(['1', '0', cc, string.strip(ccflags + ' -O'), 'v', 'v'])
-test.run(arguments='DEBUG_BUILD=1')
+test.run(arguments='DEBUG_BUILD=1', stderr=warnings)
check(['1', '1', cc, string.strip(ccflags + ' -O -g'), 'v', 'v'])
test.run(arguments='-h',
@@ -201,7 +206,8 @@ UNSPECIFIED: An option with no value
actual: None
Use scons -H for help about command-line options.
-"""%(cc, ccflags and ccflags + ' -O' or '-O', cc))
+"""%(cc, ccflags and ccflags + ' -O' or '-O', cc),
+ stderr=warnings)
# Test saving of options and multi loading
#
@@ -240,17 +246,17 @@ def checkSave(file, expected):
# First test with no command line options
# This should just leave the custom.py settings
-test.run()
+test.run(stderr=warnings)
check(['1','0'])
checkSave('options.saved', { 'RELEASE_BUILD':1, 'DEBUG_BUILD':0})
# Override with command line arguments
-test.run(arguments='DEBUG_BUILD=3')
+test.run(arguments='DEBUG_BUILD=3', stderr=warnings)
check(['1','3'])
checkSave('options.saved', {'RELEASE_BUILD':1, 'DEBUG_BUILD':3})
# Now make sure that saved options are overridding the custom.py
-test.run()
+test.run(stderr=warnings)
check(['1','3'])
checkSave('options.saved', {'DEBUG_BUILD':3, 'RELEASE_BUILD':1})
@@ -288,17 +294,17 @@ opts.Save('options.saved', env)
""")
# First check for empty output file when nothing is passed on command line
-test.run()
+test.run(stderr=warnings)
check(['0','1'])
checkSave('options.saved', {})
# Now specify one option the same as default and make sure it doesn't write out
-test.run(arguments='DEBUG_BUILD=1')
+test.run(arguments='DEBUG_BUILD=1', stderr=warnings)
check(['0','1'])
checkSave('options.saved', {})
# Now specify same option non-default and make sure only it is written out
-test.run(arguments='DEBUG_BUILD=0 LISTOPTION_TEST=a,b')
+test.run(arguments='DEBUG_BUILD=0 LISTOPTION_TEST=a,b', stderr=warnings)
check(['0','0'])
checkSave('options.saved',{'DEBUG_BUILD':0, 'LISTOPTION_TEST':'a,b'})
@@ -351,7 +357,8 @@ UNSPECIFIED: An option with no value
actual: None
Use scons -H for help about command-line options.
-"""%cc)
+"""%cc,
+ stderr=warnings)
test.write('SConstruct', """
import SCons.Options
@@ -359,6 +366,6 @@ env1 = Environment(options = Options())
env2 = Environment(options = SCons.Options.Options())
""")
-test.run()
+test.run(stderr=warnings)
test.pass_test()
diff --git a/test/Deprecated/Options/PackageOption.py b/test/Deprecated/Options/PackageOption.py
index b7dbc710..11b8df0d 100644
--- a/test/Deprecated/Options/PackageOption.py
+++ b/test/Deprecated/Options/PackageOption.py
@@ -39,7 +39,7 @@ except NameError:
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
@@ -70,21 +70,27 @@ print env['x11']
Default(env.Alias('dummy', None))
""")
-test.run()
+warnings = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+%s
+scons: warning: The PackageOption\\(\\) function is deprecated; use the PackageVariable\\(\\) function instead.
+%s""" % (TestSCons.file_expr, TestSCons.file_expr)
+
+test.run(stderr=warnings)
check([str(True)])
-test.run(arguments='x11=no')
+test.run(arguments='x11=no', stderr=warnings)
check([str(False)])
-test.run(arguments='x11=0')
+test.run(arguments='x11=0', stderr=warnings)
check([str(False)])
-test.run(arguments=['x11=%s' % test.workpath()])
+test.run(arguments=['x11=%s' % test.workpath()], stderr=warnings)
check([test.workpath()])
-expect_stderr = """
-scons: *** Path does not exist for option x11: /non/existing/path/
-""" + test.python_file_line(SConstruct_path, 14)
+expect_stderr = warnings + """
+scons: \\*\\*\\* Path does not exist for option x11: /non/existing/path/
+""" + TestSCons.file_expr
test.run(arguments='x11=/non/existing/path/', stderr=expect_stderr, status=2)
diff --git a/test/Deprecated/Options/PathOption.py b/test/Deprecated/Options/PathOption.py
index 3fa7e818..9b845a13 100644
--- a/test/Deprecated/Options/PathOption.py
+++ b/test/Deprecated/Options/PathOption.py
@@ -34,7 +34,7 @@ import string
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
@@ -72,40 +72,43 @@ print env.subst('$qt_libraries')
Default(env.Alias('dummy', None))
""" % (workpath, os.path.join('$qtdir', 'lib') ))
+warnings = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+%s
+scons: warning: The PathOption\\(\\) function is deprecated; use the PathVariable\\(\\) function instead.
+%s""" % (TestSCons.file_expr, TestSCons.file_expr)
+
qtpath = workpath
libpath = os.path.join(qtpath, 'lib')
-test.run()
+test.run(stderr=warnings)
check([qtpath, os.path.join('$qtdir', 'lib'), libpath])
qtpath = os.path.join(workpath, 'qt')
libpath = os.path.join(qtpath, 'lib')
-test.run(arguments=['qtdir=%s' % qtpath])
+test.run(arguments=['qtdir=%s' % qtpath], stderr=warnings)
check([qtpath, os.path.join('$qtdir', 'lib'), libpath])
qtpath = workpath
libpath = os.path.join(qtpath, 'nolib')
-test.run(arguments=['qt_libraries=%s' % libpath])
+test.run(arguments=['qt_libraries=%s' % libpath], stderr=warnings)
check([qtpath, libpath, libpath])
qtpath = os.path.join(workpath, 'qt')
libpath = os.path.join(workpath, 'nolib')
-test.run(arguments=['qtdir=%s' % qtpath, 'qt_libraries=%s' % libpath])
+test.run(arguments=['qtdir=%s' % qtpath, 'qt_libraries=%s' % libpath], stderr=warnings)
check([qtpath, libpath, libpath])
qtpath = os.path.join(workpath, 'non', 'existing', 'path')
-SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 14)[:-1]
-expect_stderr = """
-scons: *** Path for option qtdir does not exist: %(qtpath)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* Path for option qtdir does not exist: %(qtpath)s
+""" % locals()) + TestSCons.file_expr
test.run(arguments=['qtdir=%s' % qtpath], stderr=expect_stderr, status=2)
-expect_stderr = """
-scons: *** Path for option qt_libraries does not exist: %(qtpath)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* Path for option qt_libraries does not exist: %(qtpath)s
+""" % locals()) + TestSCons.file_expr
test.run(arguments=['qt_libraries=%s' % qtpath], stderr=expect_stderr, status=2)
@@ -138,19 +141,19 @@ print env['X']
Default(env.Alias('dummy', None))
""" % default_subdir)
-test.run()
+test.run(stderr=warnings)
check([default_subdir])
-test.run(arguments=['X=%s' % existing_file])
+test.run(arguments=['X=%s' % existing_file], stderr=warnings)
check([existing_file])
-test.run(arguments=['X=%s' % non_existing_file])
+test.run(arguments=['X=%s' % non_existing_file], stderr=warnings)
check([non_existing_file])
-test.run(arguments=['X=%s' % existing_subdir])
+test.run(arguments=['X=%s' % existing_subdir], stderr=warnings)
check([existing_subdir])
-test.run(arguments=['X=%s' % non_existing_subdir])
+test.run(arguments=['X=%s' % non_existing_subdir], stderr=warnings)
check([non_existing_subdir])
test.must_not_exist(non_existing_file)
@@ -171,34 +174,29 @@ print env['X']
Default(env.Alias('dummy', None))
""" % default_file)
-SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 6)[:-1]
-
-expect_stderr = """
-scons: *** File path for option X does not exist: %(default_file)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* File path for option X does not exist: %(default_file)s
+""" % locals()) + TestSCons.file_expr
test.run(status=2, stderr=expect_stderr)
test.write(default_file, "default_file\n")
-test.run()
+test.run(stderr=warnings)
check([default_file])
-expect_stderr = """
-scons: *** File path for option X is a directory: %(existing_subdir)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* File path for option X is a directory: %(existing_subdir)s
+""" % locals()) + TestSCons.file_expr
test.run(arguments=['X=%s' % existing_subdir], status=2, stderr=expect_stderr)
-test.run(arguments=['X=%s' % existing_file])
+test.run(arguments=['X=%s' % existing_file], stderr=warnings)
check([existing_file])
-expect_stderr = """
-scons: *** File path for option X does not exist: %(non_existing_file)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* File path for option X does not exist: %(non_existing_file)s
+""" % locals()) + TestSCons.file_expr
test.run(arguments=['X=%s' % non_existing_file], status=2, stderr=expect_stderr)
@@ -217,34 +215,31 @@ print env['X']
Default(env.Alias('dummy', None))
""" % default_subdir)
-expect_stderr = """
-scons: *** Directory path for option X does not exist: %(default_subdir)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* Directory path for option X does not exist: %(default_subdir)s
+""" % locals()) + TestSCons.file_expr
test.run(status=2, stderr=expect_stderr)
test.subdir(default_subdir)
-test.run()
+test.run(stderr=warnings)
check([default_subdir])
-expect_stderr = """
-scons: *** Directory path for option X is a file: %(existing_file)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* Directory path for option X is a file: %(existing_file)s
+""" % locals()) + TestSCons.file_expr
test.run(arguments=['X=%s' % existing_file],
status=2,
stderr=expect_stderr)
-test.run(arguments=['X=%s' % existing_subdir])
+test.run(arguments=['X=%s' % existing_subdir], stderr=warnings)
check([existing_subdir])
-expect_stderr = """
-scons: *** Directory path for option X does not exist: %(non_existing_subdir)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* Directory path for option X does not exist: %(non_existing_subdir)s
+""" % locals()) + TestSCons.file_expr
test.run(arguments=['X=%s' % non_existing_subdir],
status=2,
@@ -265,20 +260,19 @@ print env['X']
Default(env.Alias('dummy', None))
""" % default_subdir)
-test.run()
+test.run(stderr=warnings)
check([default_subdir])
-expect_stderr = """
-scons: *** Path for option X is a file, not a directory: %(existing_file)s
-%(SConstruct_file_line)s
-""" % locals()
+expect_stderr = warnings + ("""
+scons: \\*\\*\\* Path for option X is a file, not a directory: %(existing_file)s
+""" % locals()) + TestSCons.file_expr
test.run(arguments=['X=%s' % existing_file], status=2, stderr=expect_stderr)
-test.run(arguments=['X=%s' % existing_subdir])
+test.run(arguments=['X=%s' % existing_subdir], stderr=warnings)
check([existing_subdir])
-test.run(arguments=['X=%s' % non_existing_subdir])
+test.run(arguments=['X=%s' % non_existing_subdir], stderr=warnings)
check([non_existing_subdir])
test.must_exist(non_existing_subdir)
diff --git a/test/Deprecated/Options/chdir.py b/test/Deprecated/Options/chdir.py
index 7ba85eaf..dd4eb70b 100644
--- a/test/Deprecated/Options/chdir.py
+++ b/test/Deprecated/Options/chdir.py
@@ -31,7 +31,7 @@ file lives by using the __name__ value.
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
test.subdir('bin', 'subdir')
@@ -66,6 +66,10 @@ expect = """\
VARIABLE = 'opts2.cfg value'
"""
-test.run(arguments = '-q -Q .', stdout=expect)
+warnings = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+""" + TestSCons.file_expr
+
+test.run(arguments = '-q -Q .', stdout=expect, stderr=warnings)
test.pass_test()
diff --git a/test/Deprecated/Options/help.py b/test/Deprecated/Options/help.py
index d3fa9ad0..049cb1e1 100644
--- a/test/Deprecated/Options/help.py
+++ b/test/Deprecated/Options/help.py
@@ -42,7 +42,7 @@ str_False = str(False)
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
@@ -97,54 +97,71 @@ Default(env.Alias('dummy', None))
""" % locals())
-test.run(arguments='-h',
- stdout = """\
+expected_stdout = """\
scons: Reading SConscript files ...
%(str_True)s
%(str_False)s
scons: done reading SConscript files.
-warnings: compilation with -Wall and similiar (yes|no)
+warnings: compilation with -Wall and similiar \\(yes|no\\)
default: 1
actual: %(str_True)s
-profile: create profiling informations (yes|no)
+profile: create profiling informations \\(yes|no\\)
default: 0
actual: %(str_False)s
-debug: debug output and symbols (yes|no|full)
+debug: debug output and symbols \\(yes|no|full\\)
default: no
actual: no
-guilib: gui lib to use (motif|gtk|kde)
+guilib: gui lib to use \\(motif|gtk|kde\\)
default: gtk
actual: gtk
-some: some option (xaver|eins)
+some: some option \\(xaver|eins\\)
default: xaver
actual: xaver
shared: libraries to build as shared libraries
- (all|none|comma-separated list of names)
+ \\(all|none|comma-separated list of names\\)
allowed names: x11 gl qt ical
default: all
actual: x11 gl qt ical
-x11: use X11 installed here (yes = search some places)
- ( yes | no | /path/to/x11 )
+x11: use X11 installed here \\(yes = search some places\\)
+ \\( yes | no | /path/to/x11 \\)
default: yes
actual: %(str_True)s
-qtdir: where the root of Qt is installed ( /path/to/qtdir )
+qtdir: where the root of Qt is installed \\( /path/to/qtdir \\)
default: %(qtpath)s
actual: %(qtpath)s
-qt_libraries: where the Qt library is installed ( /path/to/qt_libraries )
+qt_libraries: where the Qt library is installed \\( /path/to/qt_libraries \\)
default: %(libdirvar)s
actual: %(libpath)s
Use scons -H for help about command-line options.
-""" % locals())
+""" % locals()
+
+file_expr = TestSCons.file_expr
+
+expected_stderr = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+%(file_expr)s
+scons: warning: The BoolOption\\(\\) function is deprecated; use the BoolVariable\\(\\) function instead.
+%(file_expr)s
+scons: warning: The EnumOption\\(\\) function is deprecated; use the EnumVariable\\(\\) function instead.
+%(file_expr)s
+scons: warning: The ListOption\\(\\) function is deprecated; use the ListVariable\\(\\) function instead.
+%(file_expr)s
+scons: warning: The PackageOption\\(\\) function is deprecated; use the PackageVariable\\(\\) function instead.
+%(file_expr)s
+scons: warning: The PathOption\\(\\) function is deprecated; use the PathVariable\\(\\) function instead.
+%(file_expr)s""" % locals()
+
+test.run(arguments='-h', stdout=expected_stdout, stderr=expected_stderr)
diff --git a/test/Deprecated/Options/import.py b/test/Deprecated/Options/import.py
index 0a3d3670..93849867 100644
--- a/test/Deprecated/Options/import.py
+++ b/test/Deprecated/Options/import.py
@@ -31,7 +31,7 @@ a module in that directory.
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
workpath = test.workpath('')
@@ -62,8 +62,12 @@ VARIABLE = 'bin/local_options.py'
test.write(['subdir', 'SConscript'], SConscript_contents)
-expect = "VARIABLE = bin/local_options.py\n"
+stdout = "VARIABLE = bin/local_options.py\n"
-test.run(arguments = '-q -Q .', stdout = expect)
+stderr = """
+scons: warning: The Options class is deprecated; use the Variables class instead.
+""" + TestSCons.file_expr
+
+test.run(arguments = '-q -Q .', stdout = stdout, stderr = stderr)
test.pass_test()