diff options
Diffstat (limited to 'test/Deprecated')
-rw-r--r-- | test/Deprecated/Options/BoolOption.py | 7 | ||||
-rw-r--r-- | test/Deprecated/Options/EnumOption.py | 15 | ||||
-rw-r--r-- | test/Deprecated/Options/ListOption.py | 17 | ||||
-rw-r--r-- | test/Deprecated/Options/PackageOption.py | 6 | ||||
-rw-r--r-- | test/Deprecated/Options/PathOption.py | 7 |
5 files changed, 35 insertions, 17 deletions
diff --git a/test/Deprecated/Options/BoolOption.py b/test/Deprecated/Options/BoolOption.py index 38b30d5..d45ad1b 100644 --- a/test/Deprecated/Options/BoolOption.py +++ b/test/Deprecated/Options/BoolOption.py @@ -50,12 +50,15 @@ def check(expect): test.write(SConstruct_path, """\ +from SCons.Options.BoolOption import BoolOption +BO = BoolOption + from SCons.Options import BoolOption opts = Options(args=ARGUMENTS) opts.AddOptions( BoolOption('warnings', 'compilation with -Wall and similiar', 1), - BoolOption('profile', 'create profiling informations', 0), + BO('profile', 'create profiling informations', 0), ) env = Environment(options=opts) @@ -78,7 +81,7 @@ check([str(False), str(True)]) expect_stderr = """ scons: *** Error converting option: warnings Invalid value for boolean option: irgendwas -""" + test.python_file_line(SConstruct_path, 9) +""" + test.python_file_line(SConstruct_path, 12) 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 610a485..29724f3 100644 --- a/test/Deprecated/Options/EnumOption.py +++ b/test/Deprecated/Options/EnumOption.py @@ -44,6 +44,9 @@ def check(expect): test.write(SConstruct_path, """\ +from SCons.Options.EnumOption import EnumOption +EO = EnumOption + from SCons.Options import EnumOption list_of_libs = Split('x11 gl qt ical') @@ -56,9 +59,9 @@ opts.AddOptions( EnumOption('guilib', 'gui lib to use', 'gtk', allowed_values=('motif', 'gtk', 'kde'), map={}, ignorecase=1), # case insensitive - EnumOption('some', 'some option', 'xaver', - allowed_values=('xaver', 'eins'), - map={}, ignorecase=2), # make lowercase + EO('some', 'some option', 'xaver', + allowed_values=('xaver', 'eins'), + map={}, ignorecase=2), # make lowercase ) env = Environment(options=opts) @@ -82,19 +85,19 @@ check(['full', 'KdE', 'eins']) expect_stderr = """ scons: *** Invalid value for option debug: FULL -""" + test.python_file_line(SConstruct_path, 18) +""" + test.python_file_line(SConstruct_path, 21) 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, 18) +""" + test.python_file_line(SConstruct_path, 21) 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, 18) +""" + test.python_file_line(SConstruct_path, 21) 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 1ce20a2..7e7b18f 100644 --- a/test/Deprecated/Options/ListOption.py +++ b/test/Deprecated/Options/ListOption.py @@ -47,6 +47,9 @@ def check(expect): test.write(SConstruct_path, """\ +from SCons.Options.ListOption import ListOption +LO = ListOption + from SCons.Options import ListOption list_of_libs = Split('x11 gl qt ical') @@ -59,6 +62,7 @@ opts.AddOptions( 'all', names = list_of_libs, map = {'GL':'gl', 'QT':'qt'}), + LO('listvariable', 'listvariable help', 'all', names=['l1', 'l2', 'l3']) ) env = Environment(options=opts) @@ -81,7 +85,8 @@ test.run() check(['all', '1', 'gl ical qt x11', 'gl ical qt x11', "['gl ical qt x11']"]) -test.must_match(test.workpath('scons.options'), "shared = 'all'"+os.linesep) +expect = "shared = 'all'"+os.linesep+"listvariable = 'all'"+os.linesep +test.must_match(test.workpath('scons.options'), expect) check(['all', '1', 'gl ical qt x11', 'gl ical qt x11', "['gl ical qt x11']"]) @@ -110,7 +115,7 @@ 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, 15) +""" + test.python_file_line(SConstruct_path, 19) test.run(arguments='shared=foo', stderr=expect_stderr, status=2) @@ -119,28 +124,28 @@ test.run(arguments='shared=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, 15) +""" + test.python_file_line(SConstruct_path, 19) 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, 15) +""" + test.python_file_line(SConstruct_path, 19) 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, 15) +""" + test.python_file_line(SConstruct_path, 19) 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, 15) +""" + test.python_file_line(SConstruct_path, 19) test.run(arguments='shared=foo,x11,,,bar', stderr=expect_stderr, status=2) diff --git a/test/Deprecated/Options/PackageOption.py b/test/Deprecated/Options/PackageOption.py index 79d4dda..b7dbc71 100644 --- a/test/Deprecated/Options/PackageOption.py +++ b/test/Deprecated/Options/PackageOption.py @@ -50,6 +50,9 @@ def check(expect): test.write(SConstruct_path, """\ +from SCons.Options.PackageOption import PackageOption +PO = PackageOption + from SCons.Options import PackageOption opts = Options(args=ARGUMENTS) @@ -57,6 +60,7 @@ opts.AddOptions( PackageOption('x11', 'use X11 installed here (yes = search some places', 'yes'), + PO('package', 'help for package', 'yes'), ) env = Environment(options=opts) @@ -80,7 +84,7 @@ check([test.workpath()]) expect_stderr = """ scons: *** Path does not exist for option x11: /non/existing/path/ -""" + test.python_file_line(SConstruct_path, 10) +""" + test.python_file_line(SConstruct_path, 14) 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 23fec6e..3fa7e81 100644 --- a/test/Deprecated/Options/PathOption.py +++ b/test/Deprecated/Options/PathOption.py @@ -49,6 +49,9 @@ workpath = test.workpath() libpath = os.path.join(workpath, 'lib') test.write(SConstruct_path, """\ +from SCons.Options.PathOption import PathOption +PO = PathOption + from SCons.Options import PathOption qtdir = r'%s' @@ -56,7 +59,7 @@ qtdir = r'%s' opts = Options(args=ARGUMENTS) opts.AddOptions( PathOption('qtdir', 'where the root of Qt is installed', qtdir), - PathOption('qt_libraries', 'where the Qt library is installed', r'%s'), + PO('qt_libraries', 'where the Qt library is installed', r'%s'), ) env = Environment(options=opts) @@ -90,7 +93,7 @@ test.run(arguments=['qtdir=%s' % qtpath, 'qt_libraries=%s' % libpath]) check([qtpath, libpath, libpath]) qtpath = os.path.join(workpath, 'non', 'existing', 'path') -SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 11)[:-1] +SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 14)[:-1] expect_stderr = """ scons: *** Path for option qtdir does not exist: %(qtpath)s |