summaryrefslogtreecommitdiff
path: root/test/Help.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2015-09-29 08:54:32 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2015-09-29 08:54:32 -0700
commitb66ef49d3beeda59267c26c0f441cf487c9c85cc (patch)
treea15b460d841d92de81478b8646af8b39b6dbc4a6 /test/Help.py
parent87d4a7b537f04e87d2afa23087ff1f8abac2516b (diff)
downloadscons-b66ef49d3beeda59267c26c0f441cf487c9c85cc.tar.gz
test for pull request #226 bug #2831
Diffstat (limited to 'test/Help.py')
-rw-r--r--test/Help.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/Help.py b/test/Help.py
index 747fe597..693fd286 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: