- Don't fail if can't import a _subprocess module on Windows.
+ - Add warnings for use of the deprecated Options object.
+
From Greg Spencer:
- Support implicit dependency scanning of files encoded in utf-8
"""
import SCons.Variables
+import SCons.Warnings
-BoolOption = SCons.Variables.BoolVariable
+warned = False
+
+def BoolOption(*args, **kw):
+ global warned
+ if not warned:
+ msg = "The BoolOption() function is deprecated; use the BoolVariable() function instead."
+ SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
+ warned = True
+ return apply(SCons.Variables.BoolVariable, args, kw)
"""
import SCons.Variables
+import SCons.Warnings
-EnumOption = SCons.Variables.EnumVariable
+warned = False
+
+def EnumOption(*args, **kw):
+ global warned
+ if not warned:
+ msg = "The EnumOption() function is deprecated; use the EnumVariable() function instead."
+ SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
+ warned = True
+ return apply(SCons.Variables.EnumVariable, args, kw)
"""
import SCons.Variables
+import SCons.Warnings
-ListOption = SCons.Variables.ListVariable
+warned = False
+
+def ListOption(*args, **kw):
+ global warned
+ if not warned:
+ msg = "The ListOption() function is deprecated; use the ListVariable() function instead."
+ SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
+ warned = True
+ return apply(SCons.Variables.ListVariable, args, kw)
"""
import SCons.Variables
+import SCons.Warnings
-PackageOption = SCons.Variables.PackageVariable
+warned = False
+
+def PackageOption(*args, **kw):
+ global warned
+ if not warned:
+ msg = "The PackageOption() function is deprecated; use the PackageVariable() function instead."
+ SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
+ warned = True
+ return apply(SCons.Variables.PackageVariable, args, kw)
"""
import SCons.Variables
+import SCons.Warnings
-PathOption = SCons.Variables.PathVariable
+warned = False
+
+class _PathOptionClass:
+ def warn(self):
+ global warned
+ if not warned:
+ msg = "The PathOption() function is deprecated; use the PathVariable() function instead."
+ SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
+ warned = True
+
+ def __call__(self, *args, **kw):
+ self.warn()
+ return apply(SCons.Variables.PathVariable, args, kw)
+
+ def PathAccept(self, *args, **kw):
+ self.warn()
+ return apply(SCons.Variables.PathVariable.PathAccept, args, kw)
+
+ def PathIsDir(self, *args, **kw):
+ self.warn()
+ return apply(SCons.Variables.PathVariable.PathIsDir, args, kw)
+
+ def PathIsDirCreate(self, *args, **kw):
+ self.warn()
+ return apply(SCons.Variables.PathVariable.PathIsDirCreate, args, kw)
+
+ def PathIsFile(self, *args, **kw):
+ self.warn()
+ return apply(SCons.Variables.PathVariable.PathIsFile, args, kw)
+
+ def PathExists(self, *args, **kw):
+ self.warn()
+ return apply(SCons.Variables.PathVariable.PathExists, args, kw)
+
+PathOption = _PathOptionClass()
"""
import SCons.Variables
+import SCons.Warnings
from BoolOption import BoolOption # okay
from EnumOption import EnumOption # okay
from PackageOption import PackageOption # naja
from PathOption import PathOption # okay
+warned = False
+
class Options(SCons.Variables.Variables):
+ def __init__(self, *args, **kw):
+ global warned
+ if not warned:
+ msg = "The Options class is deprecated; use the Variables class instead."
+ SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg)
+ warned = True
+ apply(SCons.Variables.Variables.__init__,
+ (self,) + args,
+ kw)
def AddOptions(self, *args, **kw):
return apply(SCons.Variables.Variables.AddVariables,
class DeprecatedCopyWarning(DeprecatedWarning):
pass
+class DeprecatedOptionsWarning(DeprecatedWarning):
+ pass
+
class DeprecatedSourceSignaturesWarning(DeprecatedWarning):
pass
Test the BoolOption canned Option type.
"""
-import os.path
import string
try:
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
""")
+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)
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
""")
-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)
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
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']"])
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)
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)
import TestSCons
import string
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
test.write('SConstruct', """
import string
""")
+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', """
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',
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
#
# 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})
""")
# 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'})
actual: None
Use scons -H for help about command-line options.
-"""%cc)
+"""%cc,
+ stderr=warnings)
test.write('SConstruct', """
import SCons.Options
env2 = Environment(options = SCons.Options.Options())
""")
-test.run()
+test.run(stderr=warnings)
test.pass_test()
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
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)
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
SConstruct_path = test.workpath('SConstruct')
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)
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)
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)
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,
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)
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
test.subdir('bin', 'subdir')
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()
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
""" % 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)
import TestSCons
-test = TestSCons.TestSCons()
+test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
workpath = test.workpath('')
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()