summaryrefslogtreecommitdiffstats
path: root/test/Help.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2015-09-29 15:54:32 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2015-09-29 15:54:32 (GMT)
commita0a71904847f0ea0434bdce3a93dd730bd2a0bbb (patch)
treea15b460d841d92de81478b8646af8b39b6dbc4a6 /test/Help.py
parent0a76f5e2f9a3b55995014fc18881bdb068765817 (diff)
downloadSCons-a0a71904847f0ea0434bdce3a93dd730bd2a0bbb.zip
SCons-a0a71904847f0ea0434bdce3a93dd730bd2a0bbb.tar.gz
SCons-a0a71904847f0ea0434bdce3a93dd730bd2a0bbb.tar.bz2
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 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: