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 Create a moc file from a cpp file.
33 test = TestSCons.TestSCons()
35 test.Qt_dummy_installation()
37 ##############################################################################
39 lib_aaa = TestSCons.lib_ + 'aaa' + TestSCons._lib
42 test.Qt_create_SConstruct('SConstruct')
44 test.write('SConscript', """
46 if dup == 0: env.Append(CPPPATH=['.'])
47 env.StaticLibrary(target = '%s', source = ['aaa.cpp','useit.cpp'])
50 test.write('aaa.h', r"""
54 test.write('aaa.cpp', r"""
55 #include "my_qobject.h"
56 void aaa(void) Q_OBJECT
60 test.write('useit.cpp', r"""
67 test.run(arguments=lib_aaa,
68 stderr=TestSCons.noisy_ar,
69 match=TestSCons.match_re_dotall)
71 test.up_to_date(options = '-n', arguments = lib_aaa)
73 test.write('aaa.cpp', r"""
74 #include "my_qobject.h"
76 void aaa(void) Q_OBJECT
80 test.not_up_to_date(options = '-n', arguments = moc)
82 test.run(options = '-c', arguments = lib_aaa)
84 test.run(arguments = "variant_dir=1 " + test.workpath('build', lib_aaa),
85 stderr=TestSCons.noisy_ar,
86 match=TestSCons.match_re_dotall)
88 test.run(arguments = "variant_dir=1 chdir=1 " + test.workpath('build', lib_aaa))
90 test.must_exist(test.workpath('build', moc))
92 test.run(arguments = "variant_dir=1 dup=0 " +
93 test.workpath('build_dup0', lib_aaa),
94 stderr=TestSCons.noisy_ar,
95 match=TestSCons.match_re_dotall)
97 test.must_exist(test.workpath('build_dup0', moc))