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.
27 Test the Variables help messages.
35 str_False
= str(False)
37 test
= TestSCons
.TestSCons()
39 workpath
= test
.workpath()
40 qtpath
= os
.path
.join(workpath
, 'qt')
41 libpath
= os
.path
.join(qtpath
, 'lib')
42 libdirvar
= os
.path
.join('$qtdir', 'lib')
47 test
.write('SConstruct', """
48 from SCons.Variables import (
56 list_of_libs = Split('x11 gl qt ical')
59 opts = Variables(args=ARGUMENTS)
61 BoolVariable('warnings', 'compilation with -Wall and similiar', True),
62 BoolVariable('profile', 'create profiling informations', False),
65 'debug output and symbols',
67 allowed_values=('yes', 'no', 'full'),
75 allowed_values=('motif', 'gtk', 'kde'),
83 allowed_values=('xaver', 'eins'),
88 'shared', 'libraries to build as shared libraries', 'all', names=list_of_libs
90 PackageVariable('x11', 'use X11 installed here (yes = search some places)', 'yes'),
91 PathVariable('qtdir', 'where the root of Qt is installed', qtdir),
92 PathVariable('qt_libraries', 'where the Qt library is installed', r'%(libdirvar)s'),
95 _ = DefaultEnvironment(tools=[])
96 env = Environment(variables=opts, tools=[])
97 Help(opts.GenerateHelpText(env))
99 print(env['warnings'])
100 print(env['profile'])
102 Default(env.Alias('dummy', None))
105 test
.run(arguments
='-h',
107 scons: Reading SConscript files ...
110 scons: done reading SConscript files.
112 warnings: compilation with -Wall and similiar (yes|no)
116 profile: create profiling informations (yes|no)
118 actual: %(str_False)s
120 debug: debug output and symbols (yes|no|full)
124 guilib: gui lib to use (motif|gtk|kde)
128 some: some option (xaver|eins)
132 shared: libraries to build as shared libraries
133 (all|none|comma-separated list of names)
134 allowed names: x11 gl qt ical
136 actual: x11 gl qt ical
138 x11: use X11 installed here (yes = search some places)
139 ( yes | no | /path/to/x11 )
143 qtdir: where the root of Qt is installed ( /path/to/qtdir )
147 qt_libraries: where the Qt library is installed ( /path/to/qt_libraries )
148 default: %(libdirvar)s
151 Use scons -H for help about SCons built-in command-line options.
158 # indent-tabs-mode:nil
160 # vim: set expandtab tabstop=4 shiftwidth=4: