Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/serialization/test/Jamfile @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 10.5 KB
Line 
1# Boost serialization Library test Jamfile
2
3#  (C) Copyright Robert Ramey 2002-2004.
4#  Use, modification, and distribution are subject to the
5#  Boost Software License, Version 1.0. (See accompanying file
6#  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7#
8
9subproject libs/serialization/test ;
10
11# bring in rules for testing
12import testing ;
13
14import ../build/serialization ;
15
16{
17
18# Make tests run by default.
19DEPENDS all : test ;
20
21# these are used to shorten testing while in development.  It permits
22# testing to be applied to just a particular type of archive
23if ! $(BOOST_ARCHIVE_LIST) {
24    BOOST_ARCHIVE_LIST =
25        "text_archive.hpp"
26        "text_warchive.hpp"
27        "binary_archive.hpp"
28        "xml_archive.hpp"
29        "xml_warchive.hpp"
30    ;
31    # enable the tests which don't depend on a particular archive
32    BOOST_SERIALIZATION_TEST = true ;
33}
34
35# look in BOOST_ROOT for sources first, just in this Jamfile
36local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;
37
38rule run-template ( test-name : sources * : requirements * ) {
39    return [
40        run
41            <lib>../../test/build/boost_test_exec_monitor
42            $(sources)
43        : # command
44        : # input files
45        : # requirements
46            std::locale-support
47            toolset::require-boost-spirit-support
48            toolset::suppress-warnings
49            toolset::optimizations
50            $(requirements)
51        : # test name
52            $(test-name)
53        : # default-build
54            debug
55    ] ;
56}
57
58# each of the following tests is run with each type of archive
59rule run-invoke ( test-name : sources * : defns * )
60{   
61    if [ in-invocation-subdir ] { Echo $(test-name) ; }
62    local tests ;
63    tests += [
64        run-template $(test-name)
65        : # sources
66            $(sources)
67            <lib>../build/boost_serialization
68        : # requirements
69            # msvc stlport 4.5.3 only works with static lib
70            <msvc-stlport><*><runtime-link>static
71            <vc-6_5-stlport><*><runtime-link>static
72            <define>$(defns)
73            <define>BOOST_LIB_DIAGNOSTIC=1
74    ] ;
75    if [ in-invocation-subdir ] { Echo $(test-name)_dll ; }
76    tests += [
77        run-template $(test-name)_dll
78        : # sources
79            $(sources)
80            <dll>../build/boost_serialization
81        : # requiremens
82            toolset::require-shared-libraries-support
83            <define>$(defns)
84            <define>BOOST_LIB_DIAGNOSTIC=1
85            <define>BOOST_ALL_DYN_LINK=1
86            <runtime-link>dynamic
87    ] ;
88    return $(tests) ;
89}
90
91# each of the following tests is run with each type of archive
92rule run-winvoke ( test-name : sources * : defns * )
93{
94    if [ in-invocation-subdir ] { Echo $(test-name) ; }
95    local tests ;
96    tests += [
97        run-template $(test-name)
98        : # sources
99            $(sources)
100            <lib>../build/boost_serialization
101            <lib>../build/boost_wserialization
102        : # requirements
103            toolset::require-wide-char-io-support
104            <define>$(defns)
105            <define>BOOST_LIB_DIAGNOSTIC=1
106            # msvc stlport 4.5.3 only works with static lib
107            <msvc-stlport><*><runtime-link>static
108            <vc-6_5-stlport><*><runtime-link>static
109            # both stlport and msvc6 define iswspace
110            <msvc-stlport><*><linkflags>"-force:multiple"
111            <vc-6_5-stlport><*><linkflags>"-force:multiple"
112    ] ;
113    if [ in-invocation-subdir ] { Echo $(test-name)_dll ; }
114    tests += [
115        run-template $(test-name)_dll
116        : # sources
117            $(sources)
118            <dll>../build/boost_serialization
119            <dll>../build/boost_wserialization
120        : # requiremens
121            toolset::require-wide-char-io-support
122            toolset::require-shared-libraries-support
123            <define>$(defns)
124            <define>BOOST_LIB_DIAGNOSTIC=1
125            <define>BOOST_ALL_DYN_LINK=1
126            <runtime-link>dynamic
127    ] ;
128    return $(tests) ;
129}
130
131# for tests which don't use library code - usually just headers
132rule test-bsl-run-no-lib  ( test-name : sources * )
133{
134    if [ in-invocation-subdir ] { Echo $(test-name) ; }
135    local tests ;
136    tests += [
137        run-template $(test-name)
138        : # sources
139            $(test-name).cpp $(sources).cpp
140        : # requirements
141            <msvc-stlport><*><runtime-link>static
142            <vc-6_5-stlport><*><runtime-link>static
143    ] ;
144}
145
146rule test-bsl-run ( test-name : sources * )
147{
148    local tests ;
149    tests +=  [
150        run-invoke $(test-name)
151        :
152            $(test-name).cpp $(sources).cpp
153    ] ;
154    return $(tests) ;
155}
156
157rule test-bsl-run_archive ( test-name : archive-name : sources * ) {
158    local tests ;
159    switch $(archive-name) {
160    case "*_warchive" :
161        tests +=  [
162            run-winvoke $(test-name)_$(archive-name)
163            :
164                $(sources).cpp
165            :
166                BOOST_ARCHIVE_TEST=$(archive-name).hpp
167        ] ;
168    case "*" :
169        tests +=  [
170            run-invoke $(test-name)_$(archive-name)
171            :
172                $(sources).cpp
173            :
174                BOOST_ARCHIVE_TEST=$(archive-name).hpp
175        ] ;
176    }
177    return $(tests) ;
178}
179
180rule test-bsl-run_files ( test-name : sources * ) {
181    local tests ;
182    for local defn in $(BOOST_ARCHIVE_LIST) {
183        tests += [
184            test-bsl-run_archive $(test-name)
185            : $(defn:LB)
186            : $(test-name) $(sources)
187        ] ;
188    }
189    return $(tests) ;
190}
191   
192rule test-bsl-run_polymorphic_archive ( test-name : sources * ) {
193    local tests ;
194    for local defn in $(BOOST_ARCHIVE_LIST) {
195        tests += [
196            test-bsl-run_archive test
197            : polymorphic_$(defn:LB) 
198            : test_polymorphic $(sources)
199        ] ;
200    }
201    return $(tests) ;
202}
203
204test-suite "serialization" :
205     [ test-bsl-run_files test_array ]
206     [ test-bsl-run_files test_binary ]
207     [ test-bsl-run_files test_contained_class ]
208     [ test-bsl-run_files test_cyclic_ptrs ]
209     [ test-bsl-run_files test_delete_pointer ]
210     [ test-bsl-run_files test_deque ]
211     [ test-bsl-run_files test_derived ]
212     [ test-bsl-run_files test_derived_class ]
213     [ test-bsl-run_files test_derived_class_ptr ]
214     [ test-bsl-run_files test_diamond ]
215     [ test-bsl-run_files test_exported ]
216     [ test-bsl-run_files test_class_info_save ]
217     [ test-bsl-run_files test_class_info_load ]
218     [ test-bsl-run_files test_object ]
219     [ test-bsl-run_files test_primitive ]
220     [ test-bsl-run_files test_list ]
221     [ test-bsl-run_files test_list_ptrs ]
222     [ test-bsl-run_files test_map ]
223     [ test-bsl-run_files test_mi ]
224     [ test-bsl-run_files test_multiple_ptrs ]
225     [ test-bsl-run_files test_no_rtti ]
226     [ test-bsl-run_files test_non_intrusive ]
227     [ test-bsl-run_files test_non_default_ctor ]
228     [ test-bsl-run_files test_non_default_ctor2 ]
229     [ test-bsl-run_files test_null_ptr ]
230     [ test-bsl-run_files test_nvp ]
231     [ test-bsl-run_files test_recursion ]
232     [ test-bsl-run_files test_registered ]
233     [ test-bsl-run_files test_set ]
234     [ test-bsl-run_files test_simple_class ]
235     [ test-bsl-run_files test_simple_class_ptr ]
236     [ test-bsl-run_files test_split ]
237     [ test-bsl-run_files test_tracking ]
238     [ test-bsl-run_files test_unregistered ]
239     [ test-bsl-run_files test_variant ]
240     [ test-bsl-run_files test_vector ]
241     [ test-bsl-run_files test_optional ]
242     [ test-bsl-run_files test_shared_ptr ]
243     [ test-bsl-run_files test_shared_ptr_132 ]
244     [ test-bsl-run_polymorphic_archive test_polymorphic : test_polymorphic_A ]
245;
246
247if $(BOOST_SERIALIZATION_TEST) {
248    test-suite "serialization" :
249        [ test-bsl-run-no-lib test_iterators ]
250        [ test-bsl-run-no-lib test_iterators_base64 ]
251        [ test-bsl-run test_private_ctor ]
252        [ test-bsl-run test_reset_object_address ]
253        [ test-bsl-run-no-lib test_smart_cast ]
254        [ test-bsl-run-no-lib test_static_warning ]
255        [ test-bsl-run-no-lib test_utf8_codecvt : ../src/utf8_codecvt_facet ]
256        [ test-bsl-run test_void_cast ]
257        [ test-bsl-run test_mult_archive_types ]
258        [ test-bsl-run-no-lib test_codecvt_null : ../src/codecvt_null ]
259
260        # demos
261        [ test-bsl-run test_demo ]
262        [ test-bsl-run test_demo_auto_ptr ]
263        [ test-bsl-run test_demo_exception ]
264        [ test-bsl-run test_demo_fast_archive ]
265        [ test-bsl-run test_demo_pimpl : ../example/demo_pimpl_A ]
266        [ test-bsl-run test_demo_polymorphic : ../example/demo_polymorphic_A ]
267        [ test-bsl-run test_demo_portable_archive ]
268        [ test-bsl-run test_demo_shared_ptr ]
269        [ test-bsl-run test_demo_xml ]
270        [ test-bsl-run test_demo_xml_load ]
271        [ test-bsl-run test_demo_xml_save ]
272
273        # should fail compilation
274        [ compile-fail test_not_serializable.cpp : std::locale-support ]
275        [ compile-fail test_traits_fail.cpp : std::locale-support ]
276        [ compile-fail test_const_save_fail1.cpp : std::locale-support ]
277        [ compile-fail test_const_save_fail2.cpp : std::locale-support ]
278        [ compile-fail test_const_save_fail3.cpp : std::locale-support ]
279        # note - library unable to detect there errors for now
280        #[ compile-fail test_const_save_fail1_nvp.cpp ]
281        #[ compile-fail test_const_save_fail2_nvp.cpp ]
282        #[ compile-fail test_const_save_fail3_nvp.cpp ]
283        [ compile-fail test_const_load_fail1.cpp : std::locale-support ]
284        [ compile-fail test_const_load_fail2.cpp : std::locale-support ]
285        [ compile-fail test_const_load_fail3.cpp : std::locale-support ]
286        [ compile-fail test_const_load_fail1_nvp.cpp : std::locale-support ]
287        [ compile-fail test_const_load_fail2_nvp.cpp : std::locale-support ]
288        [ compile-fail test_const_load_fail3_nvp.cpp : std::locale-support ]
289
290        # should compile
291        [ compile test_inclusion.cpp ]
292        [ compile test_traits_pass.cpp : std::locale-support ]
293        [ compile test_const_pass.cpp : std::locale-support ]
294    ;
295   
296}
297
298saving-tests = [ test-bsl-run_files test_class_info_save ]
299               [ test-bsl-run test_demo_xml_save ] ;
300loading-tests = [ test-bsl-run_files test_class_info_load ]
301                [ test-bsl-run test_demo_xml_load ] ;
302
303## This makes each individual load test depend on the run of the
304## corresponding save test. It is important to do this one at a
305## time because $(saving-tests) and $(loading-tests) can contain
306## the targets for multiple toolsets.
307for local save-test-i in $(saving-tests)
308{
309    DEPENDS $(loading-tests[1]:S=.run) : $(save-test-i:S=.run) ;
310    loading-tests = $(loading-tests[2-]) ;
311}
312
313}
314
Note: See TracBrowser for help on using the repository browser.