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 manual QT builder calls.
33 test
= TestSCons
.TestSCons()
35 test
.subdir('include', 'ui')
37 test
.Qt_dummy_installation()
39 aaa_exe
= 'aaa' + TestSCons
._exe
41 test
.Qt_create_SConstruct('SConstruct')
43 test
.write('SConscript', r
"""
45 sources = ['aaa.cpp', 'bbb.cpp', 'ddd.cpp', 'eee.cpp', 'main.cpp']
48 sources.append(env.Moc('include/aaa.h'))
49 moc = env.Moc('bbb.cpp')
50 env.Ignore( moc, moc )
51 sources.extend(env.Uic('ui/ccc.ui')[1:])
53 # manual target specification
54 sources.append(env.Moc('moc-ddd.cpp', 'include/ddd.h',
55 QT_MOCHPREFIX='')) # Watch out !
56 moc = env.Moc('moc_eee.cpp', 'eee.cpp')
57 env.Ignore( moc, moc )
58 sources.extend(env.Uic(['include/uic_fff.hpp', 'fff.cpp', 'fff.moc.cpp'],
61 print(list(map(str,sources)))
62 env.Program(target='aaa',
64 CPPPATH=['$CPPPATH', './include'],
68 test
.write('aaa.cpp', r
"""
72 test
.write(['include', 'aaa.h'], r
"""
73 #include "my_qobject.h"
74 void aaa(void) Q_OBJECT;
77 test
.write('bbb.h', r
"""
81 test
.write('bbb.cpp', r
"""
82 #include "my_qobject.h"
83 void bbb(void) Q_OBJECT
87 test
.write(['ui', 'ccc.ui'], r
"""
91 test
.write('ddd.cpp', r
"""
95 test
.write(['include', 'ddd.h'], r
"""
96 #include "my_qobject.h"
97 void ddd(void) Q_OBJECT;
100 test
.write('eee.h', r
"""
104 test
.write('eee.cpp', r
"""
105 #include "my_qobject.h"
106 void eee(void) Q_OBJECT
107 #include "moc_eee.cpp"
110 test
.write(['ui', 'fff.ui'], r
"""
114 test
.write('main.cpp', r
"""
120 #include "uic_fff.hpp"
123 aaa(); bbb(); ccc(); ddd(); eee(); fff(); return 0;
127 test
.run(arguments
= aaa_exe
)
130 test
.must_exist(test
.workpath('include', 'moc_aaa.cc'))
131 test
.must_exist(test
.workpath('bbb.moc'))
132 test
.must_exist(test
.workpath('ui', 'ccc.h'))
133 test
.must_exist(test
.workpath('ui', 'uic_ccc.cc'))
134 test
.must_exist(test
.workpath('ui', 'moc_ccc.cc'))
136 # manual target spec.
137 test
.must_exist(test
.workpath('moc-ddd.cpp'))
138 test
.must_exist(test
.workpath('moc_eee.cpp'))
139 test
.must_exist(test
.workpath('include', 'uic_fff.hpp'))
140 test
.must_exist(test
.workpath('fff.cpp'))
141 test
.must_exist(test
.workpath('fff.moc.cpp'))
147 # indent-tabs-mode:nil
149 # vim: set expandtab tabstop=4 shiftwidth=4: