5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
28 Test the Options help messages.
41 str_False = str(False)
45 test = TestSCons.TestSCons()
49 workpath = test.workpath()
50 qtpath = os.path.join(workpath, 'qt')
51 libpath = os.path.join(qtpath, 'lib')
52 libdirvar = os.path.join('$qtdir', 'lib')
57 test.write('SConstruct', """
58 from SCons.Options import BoolOption, EnumOption, ListOption, \
59 PackageOption, PathOption
61 list_of_libs = Split('x11 gl qt ical')
64 opts = Options(args=ARGUMENTS)
66 BoolOption('warnings', 'compilation with -Wall and similiar', 1),
67 BoolOption('profile', 'create profiling informations', 0),
68 EnumOption('debug', 'debug output and symbols', 'no',
69 allowed_values=('yes', 'no', 'full'),
70 map={}, ignorecase=0), # case sensitive
71 EnumOption('guilib', 'gui lib to use', 'gtk',
72 allowed_values=('motif', 'gtk', 'kde'),
73 map={}, ignorecase=1), # case insensitive
74 EnumOption('some', 'some option', 'xaver',
75 allowed_values=('xaver', 'eins'),
76 map={}, ignorecase=2), # make lowercase
78 'libraries to build as shared libraries',
80 names = list_of_libs),
82 'use X11 installed here (yes = search some places)',
84 PathOption('qtdir', 'where the root of Qt is installed', qtdir),
85 PathOption('qt_libraries',
86 'where the Qt library is installed',
90 env = Environment(options=opts)
91 Help(opts.GenerateHelpText(env))
96 Default(env.Alias('dummy', None))
100 test.run(arguments='-h',
102 scons: Reading SConscript files ...
105 scons: done reading SConscript files.
107 warnings: compilation with -Wall and similiar (yes|no)
111 profile: create profiling informations (yes|no)
113 actual: %(str_False)s
115 debug: debug output and symbols (yes|no|full)
119 guilib: gui lib to use (motif|gtk|kde)
123 some: some option (xaver|eins)
127 shared: libraries to build as shared libraries
128 (all|none|comma-separated list of names)
129 allowed names: x11 gl qt ical
131 actual: x11 gl qt ical
133 x11: use X11 installed here (yes = search some places)
134 ( yes | no | /path/to/x11 )
138 qtdir: where the root of Qt is installed ( /path/to/qtdir )
142 qt_libraries: where the Qt library is installed ( /path/to/qt_libraries )
143 default: %(libdirvar)s
146 Use scons -H for help about command-line options.