diff options
Diffstat (limited to 'test/Options/BoolOption.py')
-rw-r--r-- | test/Options/BoolOption.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/Options/BoolOption.py b/test/Options/BoolOption.py index ef6491d..7af9bfd 100644 --- a/test/Options/BoolOption.py +++ b/test/Options/BoolOption.py @@ -35,13 +35,15 @@ import TestSCons test = TestSCons.TestSCons() +SConstruct_path = test.workpath('SConstruct') + def check(expect): result = string.split(test.stdout(), '\n') assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect) -test.write('SConstruct', """ +test.write(SConstruct_path, """\ from SCons.Options import BoolOption opts = Options(args=ARGUMENTS) @@ -59,18 +61,21 @@ print env['profile'] Default(env.Alias('dummy', None)) """) + + test.run() check(['1', '0']) test.run(arguments='warnings=0 profile=no profile=true') check(['0', '1']) -test.run(arguments='warnings=irgendwas', - stderr = """ +expect_stderr = """ scons: *** Error converting option: warnings Invalid value for boolean option: irgendwas -File "SConstruct", line 10, in ? -""", status=2) +File "%(SConstruct_path)s", line 9, in ? +""" % locals() + +test.run(arguments='warnings=irgendwas', stderr = expect_stderr, status=2) |