5 # Copyright The SCons Foundation
7 # Permission is hereby granted, free of charge, to any person obtaining
8 # a copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish,
11 # distribute, sublicense, and/or sell copies of the Software, and to
12 # permit persons to whom the Software is furnished to do so, subject to
13 # the following conditions:
15 # The above copyright notice and this permission notice shall be included
16 # in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 test
= TestSCons
.TestSCons()
30 wpath
= test
.workpath()
32 test
.write('SConstruct', r
"""
33 Help("Help text\ngoes here.\n")
36 expect
= """scons: Reading SConscript files ...
37 scons: done reading SConscript files.
41 Use scons -H for help about SCons built-in command-line options.
44 test
.run(arguments
= '-h', stdout
= expect
)
46 test
.write('SConstruct', r
"""
47 env = Environment(MORE='more', HELP='help')
48 env.Help("\nEven $MORE\n$HELP text!\n")
51 expect
= """scons: Reading SConscript files ...
52 scons: done reading SConscript files.
57 Use scons -H for help about SCons built-in command-line options.
60 test
.run(arguments
= '-h', stdout
= expect
)
62 test
.write('SConstruct', r
"""
72 scons: Reading SConscript files ...
73 scons: done reading SConscript files.
79 Use scons -H for help about SCons built-in command-line options.
82 test
.run(arguments
= '-h', stdout
= expect
)
84 # Bug #2831 - append flag to Help doesn't wipe out addoptions and variables used together
85 test
.write('SConstruct', r
"""
93 help='Compile with debugging symbols',
97 vars.Add(ListVariable('buildmod', 'List of modules to build', 'none', ['python']))
98 DefaultEnvironment(tools=[])
100 Help(vars.GenerateHelpText(env), append=True)
103 expect
= ".*--debugging.*Compile with debugging symbols.*buildmod: List of modules to build.*"
104 test
.run(arguments
= '-h', stdout
= expect
, match
=TestSCons
.match_re_dotall
)
107 # This test checks to verify that append=False doesn't include anything
108 # but the expected help for the specified Variable()
110 test
.write('SConstruct', r
"""
116 metavar='BDEBUGGING',
117 help='Compile with debugging symbols',
121 vars.Add(ListVariable('buildmod', 'List of modules to build', 'none', ['python']))
123 DefaultEnvironment(tools=[])
126 Help(vars.GenerateHelpText(env), append=False)
130 scons: Reading SConscript files ...
131 scons: done reading SConscript files.
133 buildmod: List of modules to build
134 (all|none|comma-separated list of names)
135 allowed names: python
139 Use scons -H for help about SCons built-in command-line options.
142 test
.run(arguments
='-h', stdout
=expect
)
144 # Enhancement: keep_local flag saves the AddOption help,
145 # but not SCons' own help.
146 test
.write('SConstruct', r
"""
152 metavar='BDEBUGGING',
153 help='Compile with debugging symbols',
157 vars.Add(ListVariable('buildmod', 'List of modules to build', 'none', ['python']))
159 DefaultEnvironment(tools=[])
162 Help(vars.GenerateHelpText(env), append=True, keep_local=True)
166 scons: Reading SConscript files ...
167 scons: done reading SConscript files.
169 --debugging Compile with debugging symbols
171 buildmod: List of modules to build
172 (all|none|comma-separated list of names)
173 allowed names: python
177 Use scons -H for help about SCons built-in command-line options.
180 test
.run(arguments
='-h', stdout
=expect
)
187 # indent-tabs-mode:nil
189 # vim: set expandtab tabstop=4 shiftwidth=4: