2 # Copyright (C) 2008-2018 Lorenzo Caminiti
3 # Distributed under the Boost Software License, Version 1.0 (see accompanying
4 # file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
5 # See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
7 import ../build/boost_contract_build ;
8 import ../../config/checks/config : requires ;
10 test-suite constructor :
11 [ boost_contract_build.subdir-run-cxx11 constructor : smoke ]
13 [ boost_contract_build.subdir-run-cxx11 constructor : decl_pre_all ]
14 [ boost_contract_build.subdir-run-cxx11 constructor : decl_pre_ends ]
15 [ boost_contract_build.subdir-run-cxx11 constructor : decl_pre_mid ]
16 [ boost_contract_build.subdir-run-cxx11 constructor : decl_pre_none ]
18 [ boost_contract_build.subdir-run-cxx11 constructor : decl_post_all ]
19 [ boost_contract_build.subdir-run-cxx11 constructor : decl_post_ends ]
20 [ boost_contract_build.subdir-run-cxx11 constructor : decl_post_mid ]
21 [ boost_contract_build.subdir-run-cxx11 constructor : decl_post_none ]
23 [ boost_contract_build.subdir-run-cxx11 constructor :
24 decl_entry_static_inv_all ]
25 [ boost_contract_build.subdir-run-cxx11 constructor :
26 decl_entry_static_inv_ends ]
27 [ boost_contract_build.subdir-run-cxx11 constructor :
28 decl_entry_static_inv_mid ]
29 [ boost_contract_build.subdir-run-cxx11 constructor :
30 decl_entry_static_inv_none ]
32 [ boost_contract_build.subdir-run-cxx11 constructor :
33 decl_exit_static_inv_all ]
34 [ boost_contract_build.subdir-run-cxx11 constructor :
35 decl_exit_static_inv_ends ]
36 [ boost_contract_build.subdir-run-cxx11 constructor :
37 decl_exit_static_inv_mid ]
38 [ boost_contract_build.subdir-run-cxx11 constructor :
39 decl_exit_static_inv_none ]
41 # No decl_entry_static_inv_... (as no obj before ctor).
43 [ boost_contract_build.subdir-run-cxx11 constructor : decl_exit_inv_all ]
44 [ boost_contract_build.subdir-run-cxx11 constructor : decl_exit_inv_ends ]
45 [ boost_contract_build.subdir-run-cxx11 constructor : decl_exit_inv_mid ]
46 [ boost_contract_build.subdir-run-cxx11 constructor : decl_exit_inv_none ]
48 [ boost_contract_build.subdir-run-cxx11 constructor : access ]
50 [ boost_contract_build.subdir-run-cxx11 constructor : ifdef ]
51 [ boost_contract_build.subdir-run-cxx11 constructor : ifdef_macro ]
53 [ boost_contract_build.subdir-run-cxx11 constructor : throwing_pre ]
54 [ boost_contract_build.subdir-run-cxx11 constructor : throwing_old ]
55 [ boost_contract_build.subdir-run-cxx11 constructor : throwing_body ]
56 [ boost_contract_build.subdir-run-cxx11 constructor : throwing_post ]
57 # No throwing_except test (as throwing twice calls terminate).
59 [ boost_contract_build.subdir-compile-fail-cxx11 constructor : pre_error ]
62 test-suite destructor :
63 [ boost_contract_build.subdir-run-cxx11 destructor : smoke ]
65 # No decl_pre_... (as dtors have no pre).
67 [ boost_contract_build.subdir-run-cxx11 destructor : decl_post_all ]
68 [ boost_contract_build.subdir-run-cxx11 destructor : decl_post_ends ]
69 [ boost_contract_build.subdir-run-cxx11 destructor : decl_post_mid ]
70 [ boost_contract_build.subdir-run-cxx11 destructor : decl_post_none ]
72 [ boost_contract_build.subdir-run-cxx11 destructor :
73 decl_entry_static_inv_all ]
74 [ boost_contract_build.subdir-run-cxx11 destructor :
75 decl_entry_static_inv_ends ]
76 [ boost_contract_build.subdir-run-cxx11 destructor :
77 decl_entry_static_inv_mid ]
78 [ boost_contract_build.subdir-run-cxx11 destructor :
79 decl_entry_static_inv_none ]
81 [ boost_contract_build.subdir-run-cxx11 destructor :
82 decl_exit_static_inv_all ]
83 [ boost_contract_build.subdir-run-cxx11 destructor :
84 decl_exit_static_inv_ends ]
85 [ boost_contract_build.subdir-run-cxx11 destructor :
86 decl_exit_static_inv_mid ]
87 [ boost_contract_build.subdir-run-cxx11 destructor :
88 decl_exit_static_inv_none ]
90 [ boost_contract_build.subdir-run-cxx11 destructor : decl_entry_inv_all ]
91 [ boost_contract_build.subdir-run-cxx11 destructor : decl_entry_inv_ends ]
92 [ boost_contract_build.subdir-run-cxx11 destructor : decl_entry_inv_mid ]
93 [ boost_contract_build.subdir-run-cxx11 destructor : decl_entry_inv_none ]
95 # No decl_exit_inv_... (as no obj after dtor).
97 [ boost_contract_build.subdir-run-cxx11 destructor : access ]
99 [ boost_contract_build.subdir-run-cxx11 destructor : ifdef ]
100 [ boost_contract_build.subdir-run-cxx11 destructor : ifdef_macro ]
102 # No throwing_pre test (as dtors have no pre).
103 [ boost_contract_build.subdir-run-cxx11 destructor : throwing_old ]
104 [ boost_contract_build.subdir-run-cxx11 destructor : throwing_body ]
105 [ boost_contract_build.subdir-run-cxx11 destructor : throwing_post ]
106 # No throwing_except test (as throwing twice calls terminate).
108 [ boost_contract_build.subdir-compile-fail-cxx11 destructor : pre_error ]
111 test-suite public_function :
112 [ boost_contract_build.subdir-run-cxx11 public_function : smoke ]
114 [ boost_contract_build.subdir-run-cxx11 public_function : decl_pre_all ]
115 [ boost_contract_build.subdir-run-cxx11 public_function : decl_pre_ends ]
116 [ boost_contract_build.subdir-run-cxx11 public_function : decl_pre_mid ]
117 [ boost_contract_build.subdir-run-cxx11 public_function : decl_pre_none ]
119 [ boost_contract_build.subdir-run-cxx11 public_function : decl_post_all ]
120 [ boost_contract_build.subdir-run-cxx11 public_function : decl_post_ends ]
121 [ boost_contract_build.subdir-run-cxx11 public_function : decl_post_mid ]
122 [ boost_contract_build.subdir-run-cxx11 public_function : decl_post_none ]
124 [ boost_contract_build.subdir-run-cxx11 public_function :
125 decl_entry_static_inv_all ]
126 [ boost_contract_build.subdir-run-cxx11 public_function :
127 decl_entry_static_inv_ends ]
128 [ boost_contract_build.subdir-run-cxx11 public_function :
129 decl_entry_static_inv_mid ]
130 [ boost_contract_build.subdir-run-cxx11 public_function :
131 decl_entry_static_inv_none ]
133 [ boost_contract_build.subdir-run-cxx11 public_function :
134 decl_exit_static_inv_all ]
135 [ boost_contract_build.subdir-run-cxx11 public_function :
136 decl_exit_static_inv_ends ]
137 [ boost_contract_build.subdir-run-cxx11 public_function :
138 decl_exit_static_inv_mid ]
139 [ boost_contract_build.subdir-run-cxx11 public_function :
140 decl_exit_static_inv_none ]
142 [ boost_contract_build.subdir-run-cxx11 public_function :
144 [ boost_contract_build.subdir-run-cxx11 public_function :
145 decl_entry_inv_ends ]
146 [ boost_contract_build.subdir-run-cxx11 public_function :
148 [ boost_contract_build.subdir-run-cxx11 public_function :
149 decl_entry_inv_none ]
151 [ boost_contract_build.subdir-run-cxx11 public_function :
153 [ boost_contract_build.subdir-run-cxx11 public_function :
155 [ boost_contract_build.subdir-run-cxx11 public_function :
157 [ boost_contract_build.subdir-run-cxx11 public_function :
160 [ boost_contract_build.subdir-run-cxx11 public_function : access ]
162 [ boost_contract_build.subdir-run-cxx11 public_function : ifdef ]
163 [ boost_contract_build.subdir-run-cxx11 public_function : ifdef_macro ]
165 [ boost_contract_build.subdir-run-cxx11 public_function : virtual ]
166 [ boost_contract_build.subdir-run-cxx11 public_function : virtual_branch ]
167 [ boost_contract_build.subdir-run-cxx11 public_function : virtual_sparse ]
168 [ boost_contract_build.subdir-run-cxx11 public_function : virtual_access ]
169 [ boost_contract_build.subdir-run-cxx11 public_function :
170 virtual_access_multi ]
171 [ boost_contract_build.subdir-run-cxx11 public_function : old_virtual ]
173 [ boost_contract_build.subdir-run-cxx11 public_function : protected ]
174 [ boost_contract_build.subdir-compile-fail public_function :
176 [ boost_contract_build.subdir-run-cxx11 public_function : friend ]
178 [ boost_contract_build.subdir-run-cxx11 public_function : throwing_pre ]
179 [ boost_contract_build.subdir-run-cxx11 public_function : throwing_old ]
180 [ boost_contract_build.subdir-run-cxx11 public_function : throwing_body ]
181 [ boost_contract_build.subdir-run-cxx11 public_function :
182 throwing_body_virtual ]
183 [ boost_contract_build.subdir-run-cxx11 public_function :
184 throwing_body_virtual_branch ]
185 [ boost_contract_build.subdir-run-cxx11 public_function : throwing_post ]
186 # No throwing_except test (as throwing twice calls terminate).
188 [ boost_contract_build.subdir-run-cxx11 public_function : max_args0 :
189 <define>BOOST_CONTRACT_MAX_ARGS=0 ]
190 [ boost_contract_build.subdir-run-cxx11 public_function : max_args0_no_tva :
191 <define>BOOST_CONTRACT_MAX_ARGS=0
192 <define>BOOST_NO_CXX11_VARIADIC_TEMPLATES
194 [ boost_contract_build.subdir-run-cxx11 public_function : max_args1 :
195 <define>BOOST_CONTRACT_MAX_ARGS=1 ]
196 [ boost_contract_build.subdir-run-cxx11 public_function : max_args1_no_tva :
197 <define>BOOST_CONTRACT_MAX_ARGS=1
198 <define>BOOST_NO_CXX11_VARIADIC_TEMPLATES
200 [ boost_contract_build.subdir-run-cxx11 public_function : max_args2 :
201 <define>BOOST_CONTRACT_MAX_ARGS=2 ]
202 [ boost_contract_build.subdir-run-cxx11 public_function : max_args2_no_tva :
203 <define>BOOST_CONTRACT_MAX_ARGS=2
204 <define>BOOST_NO_CXX11_VARIADIC_TEMPLATES
206 [ boost_contract_build.subdir-run-cxx11 public_function : max_args ]
207 [ boost_contract_build.subdir-run-cxx11 public_function : max_args_no_tva :
208 <define>BOOST_NO_CXX11_VARIADIC_TEMPLATES ]
210 [ boost_contract_build.subdir-run-cxx11 public_function :
211 max_bases ] # C++11 for BASES(...) variadic macros.
213 [ boost_contract_build.subdir-run-cxx11 public_function : overload ]
214 [ boost_contract_build.subdir-run-cxx11 public_function : overload_no_tva :
215 <define>BOOST_NO_CXX11_VARIADIC_TEMPLATES ]
217 [ boost_contract_build.subdir-compile-fail-cxx11 public_function :
218 override_error ] # C++11 for BASES(...) variadic macros.
219 [ boost_contract_build.subdir-run-cxx11 public_function : # C++11 for BASES.
220 override_permissive : <define>BOOST_CONTRACT_PERMISSIVE ]
222 [ boost_contract_build.subdir-run-cxx11 public_function : static ]
223 [ boost_contract_build.subdir-run-cxx11 public_function : static_ifdef ]
224 [ boost_contract_build.subdir-run-cxx11 public_function :
226 [ boost_contract_build.subdir-run-cxx11 public_function :
227 static_throwing_pre ]
228 [ boost_contract_build.subdir-run-cxx11 public_function :
229 static_throwing_old ]
230 [ boost_contract_build.subdir-run-cxx11 public_function :
231 static_throwing_body ]
232 [ boost_contract_build.subdir-run-cxx11 public_function :
233 static_throwing_post ]
234 # No throwing_except test (as throwing twice calls terminate).
237 test-suite invariant :
238 [ boost_contract_build.subdir-run-cxx11 invariant : decl_static_cv_const ]
239 [ boost_contract_build.subdir-run-cxx11 invariant : decl_static_cv ]
240 [ boost_contract_build.subdir-run-cxx11 invariant : decl_cv_const ]
241 [ boost_contract_build.subdir-run-cxx11 invariant : decl_static_const ]
242 [ boost_contract_build.subdir-run-cxx11 invariant : decl_static ]
243 [ boost_contract_build.subdir-run-cxx11 invariant : decl_cv ]
244 [ boost_contract_build.subdir-run-cxx11 invariant : decl_const ]
245 [ boost_contract_build.subdir-run-cxx11 invariant : decl_nothing ]
247 [ boost_contract_build.subdir-run invariant : ifdef ]
248 [ boost_contract_build.subdir-run-cxx11 invariant : ifdef_macro ]
250 [ boost_contract_build.subdir-compile-fail invariant :
251 static_mutable_error ]
252 [ boost_contract_build.subdir-run invariant : static_mutable_permissive :
253 <define>BOOST_CONTRACT_PERMISSIVE ]
254 [ boost_contract_build.subdir-compile-fail invariant : static_const_error ]
255 [ boost_contract_build.subdir-run invariant : static_const_permissive :
256 <define>BOOST_CONTRACT_PERMISSIVE ]
257 [ boost_contract_build.subdir-compile-fail invariant :
258 static_volatile_error ]
259 [ boost_contract_build.subdir-run invariant : static_volatile_permissive :
260 <define>BOOST_CONTRACT_PERMISSIVE ]
261 [ boost_contract_build.subdir-compile-fail invariant : static_cv_error ]
262 [ boost_contract_build.subdir-run invariant : static_cv_permissive :
263 <define>BOOST_CONTRACT_PERMISSIVE ]
265 [ boost_contract_build.subdir-compile-fail invariant : static_error ]
266 [ boost_contract_build.subdir-run invariant : static_permissive :
267 <define>BOOST_CONTRACT_PERMISSIVE ]
268 [ boost_contract_build.subdir-compile-fail invariant : mutable_error ]
269 [ boost_contract_build.subdir-run invariant : mutable_permissive :
270 <define>BOOST_CONTRACT_PERMISSIVE ]
271 [ boost_contract_build.subdir-compile-fail invariant : volatile_error ]
272 [ boost_contract_build.subdir-run invariant : volatile_permissive :
273 <define>BOOST_CONTRACT_PERMISSIVE ]
276 test-suite function :
277 [ boost_contract_build.subdir-run-cxx11 function : smoke ]
279 [ boost_contract_build.subdir-run-cxx11 function : decl_pre_all ]
280 [ boost_contract_build.subdir-run-cxx11 function : decl_pre_none ]
282 [ boost_contract_build.subdir-run-cxx11 function : decl_post_all ]
283 [ boost_contract_build.subdir-run-cxx11 function : decl_post_none ]
285 [ boost_contract_build.subdir-run-cxx11 function : ifdef ]
286 [ boost_contract_build.subdir-run-cxx11 function : ifdef_macro ]
288 [ boost_contract_build.subdir-run-cxx11 function : throwing_pre ]
289 [ boost_contract_build.subdir-run-cxx11 function : throwing_old ]
290 [ boost_contract_build.subdir-run-cxx11 function : throwing_body ]
291 [ boost_contract_build.subdir-run-cxx11 function : throwing_post ]
292 # No throwing_except test (as throwing twice calls terminate).
296 [ boost_contract_build.subdir-run-cxx11 check : decl_class ]
297 [ boost_contract_build.subdir-run-cxx11 check : decl_macro ]
299 [ boost_contract_build.subdir-run-cxx11 check : ifdef ]
300 [ boost_contract_build.subdir-run-cxx11 check : ifdef_macro ]
302 [ boost_contract_build.subdir-run-cxx11 check : audit :
303 <define>BOOST_CONTRACT_AUDITS ]
304 [ boost_contract_build.subdir-compile-fail-cxx11 check : audit_error ]
305 [ boost_contract_build.subdir-run-cxx11 check : audit_disabled ]
306 [ boost_contract_build.subdir-compile-fail-cxx11 check :
307 audit_disabled_error ]
308 [ boost_contract_build.subdir-run check : axiom ]
309 [ boost_contract_build.subdir-compile-fail check : axiom_error ]
313 [ boost_contract_build.subdir-run-cxx11 result : mixed_optional ]
314 [ boost_contract_build.subdir-run-cxx11 result : mixed_optional_ref ]
316 [ boost_contract_build.subdir-compile-fail-cxx11 result :
317 type_mismatch_error ] # C++11 for BASES(...) variadic macros.
321 [ boost_contract_build.subdir-run old : auto :
322 [ requires cxx11_auto_declarations ] ]
324 [ boost_contract_build.subdir-run-cxx11 old : no_macro ]
325 [ boost_contract_build.subdir-run-cxx11 old : no_macro_if_copyable ]
327 [ boost_contract_build.subdir-compile-fail old : no_make_old_error ]
328 [ boost_contract_build.subdir-compile-fail old :
329 no_make_old_if_copyable_error ]
331 [ boost_contract_build.subdir-run-cxx11 old : if_copyable ]
332 [ boost_contract_build.subdir-compile-fail-cxx11 old : if_copyable_error ]
333 [ boost_contract_build.subdir-run-cxx11 old : if_copyable_macro ]
335 [ boost_contract_build.subdir-run old : copyable_traits ]
339 [ boost_contract_build.subdir-run-cxx11 disable : nothing_for_pre_prog :
340 <define>BOOST_CONTRACT_PRECONDITIONS_DISABLE_NO_ASSERTION ]
341 [ boost_contract_build.subdir-run-cxx11 disable : other_assertions_prog ]
343 [ boost_contract_build.subdir-lib-cxx11 disable : lib_a :
344 <link>shared:<define>BOOST_CONTRACT_TEST_LIB_A_DYN_LINK ]
345 [ boost_contract_build.subdir-lib-cxx11 disable : lib_b :
346 <library>disable-lib_a
347 <link>shared:<define>BOOST_CONTRACT_TEST_LIB_B_DYN_LINK
349 [ boost_contract_build.subdir-run-cxx11 disable : other_assertions_lib :
350 <library>disable-lib_a <library>disable-lib_b ]
352 [ boost_contract_build.subdir-run-cxx11 disable : other_assertions_unit
353 disable/lib_a.cpp disable/lib_b.cpp ]
355 [ boost_contract_build.subdir-lib-cxx11 disable : lib_x :
356 <define>BOOST_CONTRACT_NO_POSTCONDITIONS
357 <define>BOOST_CONTRACT_NO_EXCEPTS
358 <link>shared:<define>BOOST_CONTRACT_TEST_LIB_X_DYN_LINK
360 [ boost_contract_build.subdir-lib-cxx11 disable : lib_y :
361 <library>disable-lib_x
362 <define>BOOST_CONTRACT_NO_POSTCONDITIONS
363 <define>BOOST_CONTRACT_NO_EXCEPTS
364 <link>shared:<define>BOOST_CONTRACT_TEST_LIB_Y_DYN_LINK
366 [ boost_contract_build.subdir-run-cxx11 disable : no_post_except_lib :
367 <library>disable-lib_x <library>disable-lib_y ]
369 [ boost_contract_build.subdir-run-cxx11 disable : no_post_except_unit
370 disable/lib_x.cpp disable/lib_y.cpp :
371 <define>BOOST_CONTRACT_NO_POSTCONDITIONS
372 <define>BOOST_CONTRACT_NO_EXCEPTS
375 [ boost_contract_build.subdir-run disable : audit :
376 <define>BOOST_CONTRACT_AUDITS ]
377 [ boost_contract_build.subdir-compile-fail disable : audit_error ]
378 [ boost_contract_build.subdir-run disable : audit_disabled ]
379 [ boost_contract_build.subdir-compile-fail disable : audit_disabled_error ]
380 [ boost_contract_build.subdir-run disable : axiom ]
381 [ boost_contract_build.subdir-compile-fail disable : axiom_error ]
385 [ boost_contract_build.subdir-run-cxx11 specify : pre_old_post_except ]
387 [ boost_contract_build.subdir-run-cxx11 specify : pre_old_post ]
388 [ boost_contract_build.subdir-run-cxx11 specify : pre_old_except ]
389 [ boost_contract_build.subdir-run-cxx11 specify : pre_post_except ]
390 [ boost_contract_build.subdir-run-cxx11 specify : old_post_except ]
392 [ boost_contract_build.subdir-run-cxx11 specify : pre_old ]
393 [ boost_contract_build.subdir-run-cxx11 specify : pre_post ]
394 [ boost_contract_build.subdir-run-cxx11 specify : pre_except ]
395 [ boost_contract_build.subdir-run-cxx11 specify : old_post ]
396 [ boost_contract_build.subdir-run-cxx11 specify : old_except ]
397 [ boost_contract_build.subdir-run-cxx11 specify : post_except ]
399 [ boost_contract_build.subdir-run-cxx11 specify : pre ]
400 [ boost_contract_build.subdir-run-cxx11 specify : old ]
401 [ boost_contract_build.subdir-run-cxx11 specify : post ]
402 [ boost_contract_build.subdir-run-cxx11 specify : except ]
404 [ boost_contract_build.subdir-run specify : nothing ]
406 [ boost_contract_build.subdir-compile-fail-cxx11 specify :
408 [ boost_contract_build.subdir-compile-fail-cxx11 specify :
410 [ boost_contract_build.subdir-compile-fail-cxx11 specify :
412 [ boost_contract_build.subdir-compile-fail-cxx11 specify : post_old_error ]
413 [ boost_contract_build.subdir-compile-fail-cxx11 specify : post_pre_error ]
414 [ boost_contract_build.subdir-compile-fail-cxx11 specify : old_pre_error ]
416 [ boost_contract_build.subdir-run-cxx11 specify : missing_check :
417 <define>BOOST_CONTRACT_ON_MISSING_CHECK_DECL=\"\{\ throw\ err()\;\ \}\"
420 [ boost_contract_build.subdir-compile-fail specify : auto_error :
421 [ requires cxx11_auto_declarations ] ]
422 [ boost_contract_build.subdir-compile-fail-cxx11 specify : auto_pre_error :
423 [ requires cxx11_auto_declarations ] ]
424 [ boost_contract_build.subdir-compile-fail-cxx11 specify :
425 auto_pre_old_error : [ requires cxx11_auto_declarations ] ]
426 [ boost_contract_build.subdir-compile-fail-cxx11 specify :
427 auto_pre_old_post_error : [ requires cxx11_auto_declarations ] ]
428 [ boost_contract_build.subdir-compile-fail-cxx11 specify
429 : auto_pre_old_post_except_error
430 : [ requires cxx11_auto_declarations ]
435 [ boost_contract_build.subdir-run-cxx11 call_if : true_ ]
436 [ boost_contract_build.subdir-run-cxx11 call_if : false_ ]
438 [ boost_contract_build.subdir-run-cxx11 call_if : true_void ]
439 [ boost_contract_build.subdir-run-cxx11 call_if : false_void ]
441 [ boost_contract_build.subdir-run-cxx11 call_if : equal_to ]
442 [ boost_contract_build.subdir-run-cxx11 call_if : equal_to_cxx14 :
443 [ requires cxx14_generic_lambdas ] ]
445 [ boost_contract_build.subdir-run-cxx11 call_if : no_equal_condition_if ]
446 [ boost_contract_build.subdir-run-cxx11 call_if : no_equal_call_if ]
447 [ boost_contract_build.subdir-compile-fail-cxx11 call_if : no_equal_error ]