Imported Upstream version 1.51.0
[platform/upstream/boost.git] / libs / chrono / test / Jamfile.v2
1 # Boost Chrono Library test Jamfile
2
3 # Copyright Beman Dawes 2008
4 # Copyright Vicente J. Botet Escriba 2009-2010
5
6 # Distributed under the Boost Software License, Version 1.0.
7 # See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt
8
9 # See library home page at http://www.boost.org/libs/chrono
10
11 import os ;
12 import feature ;
13
14 project
15     : requirements
16         <target-os>freebsd:<linkflags>"-lrt" 
17         <target-os>linux:<linkflags>"-lrt" 
18         <toolset>clang/<target-os>linux:<linkflags>"-lpthread" 
19         <toolset>pgi:<linkflags>"-lrt" 
20         #<threading>single:<define>BOOST_CHRONO_THREAD_DISABLED
21         <toolset>msvc:<asynch-exceptions>on
22         <define>BOOST_CHRONO_USES_MPL_ASSERT
23         <define>BOOST_SYSTEM_NO_DEPRECATED
24         #<toolset>sun:<define>BOOST_COMMON_TYPE_DONT_USE_TYPEOF
25         #<toolset>sun:<define>BOOST_TYPEOF_EMULATION
26         <toolset>sun:<define>__typeof__=__typeof__ 
27         <warnings>all
28         <toolset>gcc:<cxxflags>-Wextra
29         <toolset>gcc:<cxxflags>-pedantic
30         <toolset>gcc:<cxxflags>-Wno-long-long
31         <toolset>darwin:<cxxflags>-Wextra
32         <toolset>darwin:<cxxflags>-pedantic
33         <toolset>darwin:<cxxflags>-Wno-long-long
34         #<toolset>pathscale:<cxxflags>-Wextra
35         <toolset>pathscale:<cxxflags>-Wno-long-long
36         <toolset>pathscale:<cxxflags>-pedantic
37         <toolset>clang:<cxxflags>-Wextra
38         <toolset>clang:<cxxflags>-pedantic
39         <toolset>clang:<cxxflags>-Wno-long-long
40         <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
41         <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
42         <toolset>msvc:<cxxflags>/wd4127
43 # Note: Some of the remarks from the Intel compiler are disabled
44 # remark #304: access control not specified ("public" by default)
45 # remark #383: value copied to temporary, reference to temporary used
46 # remark #1418: external function definition with no prior declaration
47         <toolset>intel:<cxxflags>-wd304,383,1418
48     ;
49
50 rule chrono-run ( sources )
51 {
52     return
53     [ run $(sources) ../build//boost_chrono
54         : :
55         :
56             <library>/boost/system//boost_system
57         :   $(sources[1]:B)_shared ]
58     #[ run $(sources) ../build//boost_chrono/<link>static
59     #    : :
60     #    :
61     #        <library>/boost/system//boost_system
62     #    :   $(sources[1]:B)_static ]
63     [ run $(sources)
64         : :
65         :   <define>BOOST_CHRONO_HEADER_ONLY
66             <define>BOOST_ERROR_CODE_HEADER_ONLY
67            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
68         :   $(sources[1]:B)_header ]
69     ;
70 }
71 rule chrono-run2 ( sources : name )
72 {
73     return
74     [ run $(sources) ../build//boost_chrono
75         : :
76         :
77             <library>/boost/system//boost_system
78         :   $(name)_shared ]
79     #[ run $(sources) ../build//boost_chrono/<link>static
80     #    : :
81     #    :
82     #        <library>/boost/system//boost_system
83     #    : $(name)_static ]
84     [ run $(sources)
85         : :
86         :   <define>BOOST_CHRONO_HEADER_ONLY
87             <define>BOOST_ERROR_CODE_HEADER_ONLY
88            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
89         : $(name)_header ]
90     ;
91 }
92
93
94 rule chrono-run-mt ( sources )
95 {
96     return
97     [ run $(sources) ../build//boost_chrono
98         : :
99         :
100             <library>/boost/system//boost_system
101         :   $(sources[1]:B)_shared ]
102     #[ run $(sources) ../build//boost_chrono/<link>static
103     #    : :
104     #    :
105     #        <library>/boost/system//boost_system
106     #    :  $(sources[1]:B)_static ]
107     [ run $(sources)
108         : :
109         :   <define>BOOST_CHRONO_HEADER_ONLY
110             <define>BOOST_ERROR_CODE_HEADER_ONLY
111            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
112         :   $(sources[1]:B)_header ]
113     ;
114 }
115 rule chrono-run2-mt ( sources : name )
116 {
117     return
118     [ run $(sources) ../build//boost_chrono
119         : :
120         :
121             <library>/boost/system//boost_system
122         :   $(name)_shared ]
123     #[ run $(sources) ../build//boost_chrono/<link>static
124     #    : :
125     #    :
126     #        <library>/boost/system//boost_system
127     #    : $(name)_static ]
128     [ run $(sources)
129         : :
130         :   <define>BOOST_CHRONO_HEADER_ONLY
131             <define>BOOST_ERROR_CODE_HEADER_ONLY
132            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
133         : $(name)_header ]
134     ;
135 }
136
137 rule chrono-run-check ( sources )
138 {
139     return
140     [ run $(sources) 
141         : :
142         :
143             <library>/boost/system//boost_system
144         :   $(sources[1]:B)_shared ]
145     [ run $(sources) 
146         : :
147         :
148             <library>/boost/system//boost_system
149         :   $(sources[1]:B)_static ]
150     [ run $(sources)
151         : :
152         :   <define>BOOST_CHRONO_HEADER_ONLY
153             <define>BOOST_ERROR_CODE_HEADER_ONLY
154            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
155         :   $(sources[1]:B)_header ]
156     ;
157 }
158
159 rule chrono-run-check2 ( sources : name )
160 {
161     return
162     [ run $(sources) 
163         : :
164         :
165             <library>/boost/system//boost_system
166         :   $(name)_shared ]
167     [ run $(sources) 
168         : :
169         :
170             <library>/boost/system//boost_system
171         : $(name)_static ]
172     [ run $(sources)
173         : :
174         :   <define>BOOST_CHRONO_HEADER_ONLY
175             <define>BOOST_ERROR_CODE_HEADER_ONLY
176            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
177         : $(name)_header ]
178     ;
179 }
180
181 rule chrono-run-header ( sources )
182 {
183     return
184     [ run $(sources)
185         : :
186         :   <define>BOOST_CHRONO_HEADER_ONLY
187             <define>BOOST_ERROR_CODE_HEADER_ONLY
188            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
189         :   $(sources[1]:B)_header ]
190     ;
191 }
192
193 rule chrono-run-header2 ( sources : name )
194 {
195     return
196     [ run $(sources)
197         : :
198         :   <define>BOOST_CHRONO_HEADER_ONLY
199             <define>BOOST_ERROR_CODE_HEADER_ONLY
200            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
201         : $(name)_header ]
202     ;
203 }
204
205 rule chrono-compile ( sources )
206 {
207     return
208     [ compile $(sources)
209         :
210         : $(sources[1]:B)_lib ]
211     [ compile $(sources)
212         :   <define>BOOST_CHRONO_HEADER_ONLY
213             <define>BOOST_ERROR_CODE_HEADER_ONLY
214            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
215         :   $(sources[1]:B)_header ]
216     ;
217 }
218
219 rule chrono-compile2 ( sources : name )
220 {
221     return
222     [ compile $(sources)
223         :
224         : $(name)_lib ]
225     [ compile $(sources)
226         :   <define>BOOST_CHRONO_HEADER_ONLY
227             <define>BOOST_ERROR_CODE_HEADER_ONLY
228            #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
229         : $(name)_header ]
230     ;
231 }
232
233
234     test-suite "examples"
235         :
236         [ chrono-run-header ../example/cycle_count.cpp  ]
237         [ chrono-run-header ../example/runtime_resolution.cpp  ]
238         [ chrono-run-header ../example/xtime.cpp ]
239         [ chrono-run-header ../example/saturating.cpp  ]
240         [ chrono-run ../example/min_time_point.cpp  ]
241         [ chrono-run-header ../example/i_dont_like_the_default_duration_behavior.cpp ]
242         [ chrono-run ../example/simulated_thread_interface_demo.cpp ]
243         [ chrono-run-header ../example/timeval_demo.cpp ]
244         [ chrono-run ../example/chrono_unit_test.cpp  ]
245         [ chrono-run-header ../example/explore_limits.cpp  ]
246         [ chrono-run-header ../example/test_duration.cpp ]
247         [ chrono-run ../example/test_clock.cpp ]
248         [ chrono-run-header ../example/miscellaneous.cpp ]
249         [ chrono-run-header ../example/test_special_values.cpp ]
250         [ chrono-run ../example/manipulate_clock_object.cpp ]
251         #[ chrono-run ../example/chrono_accuracy_test.cpp ]
252         [ chrono-run-mt ../example/test_thread_clock.cpp  ]
253         [ chrono-run-header ../example/rounding.cpp  ]
254         #[ chrono-run ../example/await_keystroke.cpp  ]
255         ;
256
257     test-suite "traits"
258         :
259         [ chrono-compile2 traits/common_type_duration_pass.cpp : traits_common_type_duration_pass ]
260         [ chrono-compile2 traits/common_type_time_point_pass.cpp : traits_common_type_time_point_pass ]
261         [ chrono-compile2 traits/treat_as_floating_point_pass.cpp : traits_treat_as_floating_point_pass  ]
262         [ chrono-run-header2 traits/duration_values_pass.cpp : traits_duration_values_pass ]
263         ;
264
265     test-suite "duration"
266         :
267         [ compile-fail duration/duration_duration_fail.cpp  ]
268         [ compile-fail duration/ratio_fail.cpp  ]
269         [ compile-fail duration/positive_num_fail.cpp  ]
270         [ chrono-compile duration/default_ratio_pass.cpp ]
271         [ chrono-compile duration/types_pass.cpp ]
272         [ chrono-compile duration/ratio_alias_pass.cpp ]
273         [ chrono-compile duration/typedefs_pass.cpp  ]
274         [ chrono-run-header duration/arithmetic_pass.cpp  ]
275         [ chrono-run-header duration/duration_cast_pass.cpp  ]
276         [ compile-fail duration/duration_cast_int_fail.cpp  ]
277         [ chrono-run-header duration/comparisons_pass.cpp  ]
278         [ chrono-run-header duration/constructor_pass.cpp  ]
279         [ compile-fail duration/cons/convert_float_to_int_fail.cpp  ]
280         [ compile-fail duration/cons/convert_inexact_fail.cpp  ]
281         [ compile-fail duration/cons/implicit_constructot_fail.cpp  ]
282         [ compile-fail duration/cons/non_implicit_convertible_rep_fail.cpp ]
283         [ compile-fail duration/cons/treat_as_floating_point_Rep2_true_fail.cpp  ]
284         [ compile-fail duration/nonmember/divide_rep2_fail.cpp  ]
285         [ compile-fail duration/nonmember/modulus_rep2_fail.cpp  ]
286         [ compile-fail duration/nonmember/times_rep2_lhs_fail.cpp ]
287         [ compile-fail duration/nonmember/times_rep2_rhs_fail.cpp ]
288         [ chrono-run-header duration/duration_values_pass.cpp ]
289         ;
290
291     test-suite "time_point"
292         :
293         [ chrono-compile2 time_point/default_duration_pass.cpp : time_point_default_duration_pass ]
294         [ compile-fail time_point/not_duration_fail.cpp : : time_point_not_duration_fail   ]
295         [ chrono-run-header2 time_point/arithmetic_pass.cpp  : time_point_arithmetic_pass ]
296         [ chrono-run-header2 time_point/arithmetic_ext_pass.cpp  : time_point_arithmetic_ext_pass ]
297         [ chrono-run-header2 time_point/time_point_cast_pass.cpp  : time_point_time_point_cast_pass ]
298         [ compile-fail time_point/time_point_cast_int_fail.cpp : : time_point_time_point_cast_int_fail   ]
299         [ chrono-run-header2 time_point/comparisons_pass.cpp  : time_point_comparisons_pass ]
300         [ compile-fail time_point/comparisons/equal_fail.cpp : : time_point_equal_fail   ]
301         [ compile-fail time_point/comparisons/less_fail.cpp : : time_point_less_fail   ]
302         [ chrono-run-header2 time_point/constructor_pass.cpp  : time_point_constructor_pass ]
303         [ compile-fail time_point/cons/implicit_fail.cpp : : time_point_implicit_fail   ]
304         [ compile-fail time_point/cons/non_implicit_convertible_duration_fail.cpp : : time_point_non_implicit_convertible_duration_fail   ]
305         [ chrono-run-header2 time_point/min_max_pass.cpp  : time_point_min_max_pass ]
306         ;
307
308     test-suite "clock"
309         :
310         [ chrono-run2-mt clock/clock_pass.cpp  : clock_clock_pass ]
311         ;
312
313     #test-suite "stopwatch"
314     #    :
315     #    [ chrono-run2 stopwatch/simple_stopwatch_pass.cpp  : simple_stopwatch_pass ]
316     #    [ chrono-run2 stopwatch/basic_stopwatch_pass.cpp  : basic_stopwatch_pass ]
317     #    [ chrono-run2 stopwatch/basic_stopwatch_last_lap_pass.cpp  : basic_stopwatch_last_lap_pass ]
318     #    [ chrono-run2 stopwatch/basic_stopwatch_laps_accumulator_set_pass.cpp  : basic_stopwatch_laps_accumulator_set_pass ]
319     #    [ chrono-run2 stopwatch/basic_stopwatch_laps_container_pass.cpp  : basic_stopwatch_laps_container_pass ]
320     #    [ chrono-run2 stopwatch/suspendable_stopwatch_pass.cpp  : suspendable_stopwatch_pass ]
321     #    ;
322
323     #test-suite "stopwatch_ex"
324     #    :
325     #    [ chrono-run ../example/stopwatch_example.cpp  ]
326     #    ;
327
328     #test-suite "stopclock"
329     #    :
330     #    [ chrono-run2 stopwatch/simple_stopwatch_reporter_pass.cpp  : simple_stopwatch_reporter_pass ]
331     #    [ chrono-run2 stopwatch/basic_stopwatch_reporter_pass.cpp  : basic_stopwatch_reporter_pass ]
332     #    [ chrono-run2 stopwatch/basic_stopwatch_reporter_laps_accumulator_set_pass.cpp  : basic_stopwatch_reporter_laps_accumulator_set_pass ]
333     #    ;
334
335     #test-suite "stopclock_ex"
336     #    :
337     #    [ chrono-run2-mt ../example/stopwatch_reporter_example.cpp  : stopwatch_reporter_example ]
338     #    ;
339
340     test-suite "io_ex"
341         :
342         [ chrono-run-mt ../example/io_ex1.cpp  ]
343         [ chrono-run-header ../example/io_ex2.cpp  ]
344         [ chrono-run ../example/io_ex3.cpp  ]
345         [ chrono-run ../example/io_ex4.cpp  ]
346         [ chrono-run ../example/io_ex5.cpp  ]
347         [ chrono-run ../example/french.cpp  ]
348         ;
349
350     test-suite "io"
351         :
352         [ chrono-run-header io/duration_input.cpp  ]
353         [ chrono-run-header io/duration_output.cpp  ]
354         [ chrono-run-header io/time_point_input.cpp  ]
355         [ chrono-run-header io/time_point_output.cpp  ]
356         ;
357
358     test-suite "win32"
359         :
360         [ chrono-run win32_test.cpp  ]
361         ;
362