From a0a71904847f0ea0434bdce3a93dd730bd2a0bbb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 29 Sep 2015 08:54:32 -0700 Subject: test for pull request #226 bug #2831 --- test/Help.py | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/test/Help.py b/test/Help.py index 747fe59..693fd28 100644 --- a/test/Help.py +++ b/test/Help.py @@ -82,6 +82,69 @@ Use scons -H for help about command-line options. test.run(arguments = '-h', stdout = expect) +# Bug #2831 - append flag to Help doesn't wipe out addoptions and variables used together +test.write('SConstruct', r""" + +AddOption('--debugging', + dest='debugging', + action='store_true', + default=False, + metavar='BDEBUGGING', + help='Compile with debugging symbols') + +vars = Variables() +vars.Add(ListVariable('buildmod', 'List of modules to build', 'none', + ['python'])) + +env = Environment() + +Help(vars.GenerateHelpText(env),append=True) +""") + +expect = ".*--debugging.*Compile with debugging symbols.*buildmod: List of modules to build.*" + +test.run(arguments = '-h', stdout = expect, match=TestSCons.match_re_dotall) + + +# Bug 2831 +# This test checks to verify that append=False doesn't include anything +# but the expected help for the specified Variable() + +test.write('SConstruct', r""" + +AddOption('--debugging', + dest='debugging', + action='store_true', + default=False, + metavar='BDEBUGGING', + help='Compile with debugging symbols') + +vars = Variables() +vars.Add(ListVariable('buildmod', 'List of modules to build', 'none', + ['python'])) + +env = Environment() + +Help(vars.GenerateHelpText(env),append=False) +""") + +expect = """\ +scons: Reading SConscript files ... +scons: done reading SConscript files. + +buildmod: List of modules to build + (all|none|comma-separated list of names) + allowed names: python + default: none + actual: None + +Use scons -H for help about command-line options. +""" + +test.run(arguments = '-h', stdout = expect) + + + test.pass_test() # Local Variables: -- cgit v0.12