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