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 that the UI scanning logic correctly picks up scansG
34 test
= TestSCons
.TestSCons()
36 if not os
.environ
.get('QTDIR', None):
37 x
="External environment variable $QTDIR not set; skipping test(s).\n"
40 test
.subdir(['layer'],
42 ['layer', 'aclock', 'qt_bug'])
44 test
.write(['SConstruct'], """\
48 env=Environment(tools=['default','expheaders','qt3'],toolpath=[aa])
49 if 'HOME' in os.environ:
50 env['ENV']['HOME'] = os.environ['HOME']
51 env["EXP_HEADER_ABS"]=os.path.join(os.getcwd(),'include')
52 if not os.access(env["EXP_HEADER_ABS"],os.F_OK):
53 os.mkdir (env["EXP_HEADER_ABS"])
55 env.SConscript('layer/aclock/qt_bug/SConscript')
58 test
.write(['expheaders.py'], """\
60 def ExpHeaderScanner(node, env, path):
63 HeaderAction=SCons.Action.Action([SCons.Defaults.Copy('$TARGET','$SOURCE'),SCons.Defaults.Chmod('$TARGET',0o755)])
64 HeaderBuilder= SCons.Builder.Builder(action=HeaderAction)
65 env['BUILDERS']['ExportHeaders'] = HeaderBuilder
70 test
.write(['layer', 'aclock', 'qt_bug', 'SConscript'], """\
74 #src=os.path.join(env.Dir('.').srcnode().abspath, 'testfile.h')
75 env.ExportHeaders(os.path.join(env["EXP_HEADER_ABS"],'main.h'), 'main.h')
76 env.ExportHeaders(os.path.join(env["EXP_HEADER_ABS"],'migraform.h'), 'migraform.h')
77 env.Append(CPPPATH=env["EXP_HEADER_ABS"])
78 env.StaticLibrary('all',['main.ui','migraform.ui'])
81 test
.write(['layer', 'aclock', 'qt_bug', 'main.ui'], """\
82 <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
84 <widget class="QWizard">
85 <property name="name">
86 <cstring>Main</cstring>
88 <property name="geometry">
98 <include location="local" impldecl="in implementation">migraform.h</include>
103 test
.write(['layer', 'aclock', 'qt_bug', 'migraform.ui'], """\
104 <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
105 <class>MigrateForm</class>
106 <widget class="QWizard">
107 <property name="name">
108 <cstring>MigrateForm</cstring>
110 <property name="geometry">
123 stderr
=TestSCons
.noisy_ar
,
124 match
=TestSCons
.match_re_dotall
,
127 test
.up_to_date(arguments
=".")
133 # indent-tabs-mode:nil
135 # vim: set expandtab tabstop=4 shiftwidth=4: