Jamfile.v2 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. # Boost Chrono Library test Jamfile
  2. # Copyright Beman Dawes 2008
  3. # Copyright Vicente J. Botet Escriba 2009-2010
  4. # Distributed under the Boost Software License, Version 1.0.
  5. # See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt
  6. # See library home page at http://www.boost.org/libs/chrono
  7. import testing ;
  8. import os ;
  9. import feature ;
  10. project
  11. : requirements
  12. <target-os>freebsd:<linkflags>"-lrt"
  13. <target-os>linux:<linkflags>"-lrt -lpthread"
  14. <toolset>clang/<target-os>linux:<linkflags>"-lpthread"
  15. <toolset>pgi:<linkflags>"-lrt"
  16. #<threading>single:<define>BOOST_CHRONO_THREAD_DISABLED
  17. <toolset>msvc:<asynch-exceptions>on
  18. <define>BOOST_CHRONO_USES_MPL_ASSERT
  19. #<toolset>sun:<define>BOOST_COMMON_TYPE_DONT_USE_TYPEOF
  20. #<toolset>sun:<define>BOOST_TYPEOF_EMULATION
  21. <toolset>sun:<define>__typeof__=__typeof__
  22. <warnings>all
  23. <toolset>gcc:<cxxflags>-Wextra
  24. #<toolset>gcc:<cxxflags>-pedantic
  25. <toolset>clang:<warnings>on
  26. <toolset>gcc:<cxxflags>-Wno-long-long
  27. <toolset>gcc:<cxxflags>-Wno-variadic-macros
  28. <toolset>darwin:<cxxflags>-Wextra
  29. <toolset>darwin:<cxxflags>-pedantic
  30. <toolset>darwin:<cxxflags>-Wno-long-long
  31. <toolset>darwin:<cxxflags>-Wno-variadic-macros
  32. #<toolset>pathscale:<cxxflags>-Wextra
  33. <toolset>pathscale:<cxxflags>-Wno-long-long
  34. <toolset>pathscale:<cxxflags>-pedantic
  35. <toolset>clang:<cxxflags>-Wextra
  36. <toolset>clang:<cxxflags>-pedantic
  37. <toolset>clang:<cxxflags>-Wno-long-long
  38. <toolset>clang:<cxxflags>-Wno-variadic-macros
  39. <toolset>gcc-4.5.0,<target-os>windows:<cxxflags>-Wno-missing-field-initializers
  40. <toolset>gcc-4.5.0,<target-os>windows:<cxxflags>-fdiagnostics-show-option
  41. <toolset>msvc:<cxxflags>/wd4127
  42. <toolset>msvc:<cxxflags>/wd4512
  43. # Note: Some of the remarks from the Intel compiler are disabled
  44. # remark #193: zero used for undefined preprocessing identifier "XXX"
  45. # remark #304: access control not specified ("public" by default)
  46. # remark #383: value copied to temporary, reference to temporary used
  47. # remark #444: destructor for base class "XXX" (declared at line YYY") is not virtual
  48. # remark #593: variable "XXX" was set but never used
  49. # remark #981: operands are evaluated in unspecified order
  50. # remark #1418: external function definition with no prior declaration
  51. # remark #2415: variable "XXX" of static storage duration was declared but never referenced
  52. <toolset>intel:<cxxflags>-wd193,304,383,444
  53. <toolset>intel:<cxxflags>-wd593,981
  54. <toolset>intel:<cxxflags>-wd1418
  55. <toolset>intel:<cxxflags>-wd2415
  56. ;
  57. rule chrono-run ( sources )
  58. {
  59. return
  60. [ run $(sources) ../build//boost_chrono
  61. : :
  62. :
  63. <define>BOOST_CHRONO_VERSION=2
  64. : $(sources[1]:B)_d ]
  65. #[ run $(sources) ../build//boost_chrono/<link>static
  66. # : :
  67. # :
  68. # : $(sources[1]:B)_s ]
  69. [ run $(sources)
  70. : :
  71. : <define>BOOST_CHRONO_HEADER_ONLY
  72. <define>BOOST_ERROR_CODE_HEADER_ONLY
  73. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  74. <define>BOOST_CHRONO_VERSION=2
  75. : $(sources[1]:B)_h ]
  76. ;
  77. }
  78. rule chrono-runXXX ( sources )
  79. {
  80. return
  81. [ run $(sources) ../build//boost_chrono
  82. : :
  83. :
  84. <define>BOOST_CHRONO_VERSION=2
  85. : $(sources[1]:B)_d ]
  86. #[ run $(sources) ../build//boost_chrono/<link>static
  87. # : :
  88. # :
  89. # : $(sources[1]:B)_s ]
  90. [ run $(sources)
  91. : :
  92. : <define>BOOST_CHRONO_HEADER_ONLY
  93. <define>BOOST_ERROR_CODE_HEADER_ONLY
  94. <define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  95. <define>BOOST_CHRONO_VERSION=2
  96. : $(sources[1]:B)_h ]
  97. ;
  98. }
  99. rule chrono-v1-v2-run ( sources )
  100. {
  101. return
  102. [ run $(sources) ../build//boost_chrono
  103. : :
  104. :
  105. <define>BOOST_CHRONO_VERSION=2
  106. : $(sources[1]:B)_d ]
  107. [ run $(sources) ../build//boost_chrono/<link>static
  108. : :
  109. :
  110. : v1_$(sources[1]:B)_s ]
  111. [ run $(sources)
  112. : :
  113. : <define>BOOST_CHRONO_HEADER_ONLY
  114. <define>BOOST_ERROR_CODE_HEADER_ONLY
  115. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  116. <define>BOOST_CHRONO_VERSION=2
  117. : $(sources[1]:B)_h ]
  118. [ run $(sources)
  119. : :
  120. : <define>BOOST_CHRONO_HEADER_ONLY
  121. <define>BOOST_ERROR_CODE_HEADER_ONLY
  122. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  123. #<define>BOOST_CHRONO_VERSION=1
  124. : v1_$(sources[1]:B)_h ]
  125. ;
  126. }
  127. rule chrono-run2 ( sources : name )
  128. {
  129. return
  130. [ run $(sources) ../build//boost_chrono
  131. : :
  132. :
  133. <define>BOOST_CHRONO_VERSION=2
  134. : $(name)_d ]
  135. #[ run $(sources) ../build//boost_chrono/<link>static
  136. # : :
  137. # :
  138. # : $(name)_s ]
  139. [ run $(sources)
  140. : :
  141. : <define>BOOST_CHRONO_HEADER_ONLY
  142. <define>BOOST_ERROR_CODE_HEADER_ONLY
  143. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  144. <define>BOOST_CHRONO_VERSION=2
  145. : $(name)_h ]
  146. ;
  147. }
  148. rule date-run ( sources + )
  149. {
  150. return
  151. [ run $(sources) ../build//boost_chrono
  152. : :
  153. :
  154. <define>BOOST_CHRONO_VERSION=2
  155. : $(sources[1]:B)_d ]
  156. ;
  157. }
  158. rule date-run-2 ( sources + : name )
  159. {
  160. return
  161. [ run $(sources) ../build//boost_chrono
  162. : :
  163. :
  164. <define>BOOST_CHRONO_VERSION=2
  165. : $(name)_d ]
  166. ;
  167. }
  168. rule chrono-run-mt ( sources )
  169. {
  170. return
  171. [ run $(sources) ../build//boost_chrono
  172. : :
  173. :
  174. <define>BOOST_CHRONO_VERSION=2
  175. : $(sources[1]:B)_d ]
  176. #[ run $(sources) ../build//boost_chrono/<link>static
  177. # : :
  178. # :
  179. # : $(sources[1]:B)_s ]
  180. [ run $(sources)
  181. : :
  182. : <define>BOOST_CHRONO_HEADER_ONLY
  183. <define>BOOST_ERROR_CODE_HEADER_ONLY
  184. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  185. <define>BOOST_CHRONO_VERSION=2
  186. : $(sources[1]:B)_h ]
  187. ;
  188. }
  189. rule chrono-run2-mt ( sources * : name )
  190. {
  191. return
  192. [ run $(sources) ../build//boost_chrono
  193. : :
  194. :
  195. <define>BOOST_CHRONO_VERSION=2
  196. : $(name)_d ]
  197. #[ run $(sources) ../build//boost_chrono/<link>static
  198. # : :
  199. # :
  200. # : $(name)_s ]
  201. [ run $(sources)
  202. : :
  203. : <define>BOOST_CHRONO_HEADER_ONLY
  204. <define>BOOST_ERROR_CODE_HEADER_ONLY
  205. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  206. <define>BOOST_CHRONO_VERSION=2
  207. : $(name)_h ]
  208. ;
  209. }
  210. rule chrono-run-check ( sources )
  211. {
  212. return
  213. [ run $(sources)
  214. : :
  215. :
  216. <define>BOOST_CHRONO_VERSION=2
  217. : $(sources[1]:B)_d ]
  218. [ run $(sources)
  219. : :
  220. :
  221. <define>BOOST_CHRONO_VERSION=2
  222. : $(sources[1]:B)_s ]
  223. [ run $(sources)
  224. : :
  225. : <define>BOOST_CHRONO_HEADER_ONLY
  226. <define>BOOST_ERROR_CODE_HEADER_ONLY
  227. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  228. <define>BOOST_CHRONO_VERSION=2
  229. : $(sources[1]:B)_h ]
  230. ;
  231. }
  232. rule chrono-run-check2 ( sources : name )
  233. {
  234. return
  235. [ run $(sources)
  236. : :
  237. :
  238. <define>BOOST_CHRONO_VERSION=2
  239. : $(name)_d ]
  240. [ run $(sources)
  241. : :
  242. :
  243. <define>BOOST_CHRONO_VERSION=2
  244. : $(name)_s ]
  245. [ run $(sources)
  246. : :
  247. : <define>BOOST_CHRONO_HEADER_ONLY
  248. <define>BOOST_ERROR_CODE_HEADER_ONLY
  249. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  250. <define>BOOST_CHRONO_VERSION=2
  251. : $(name)_h ]
  252. ;
  253. }
  254. rule chrono-run-header ( sources )
  255. {
  256. return
  257. [ run $(sources)
  258. : :
  259. : <define>BOOST_CHRONO_HEADER_ONLY
  260. <define>BOOST_ERROR_CODE_HEADER_ONLY
  261. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  262. <define>BOOST_CHRONO_VERSION=2
  263. : $(sources[1]:B)_h ]
  264. ;
  265. }
  266. rule chrono-v1-v2-run-header ( sources )
  267. {
  268. return
  269. [ run $(sources)
  270. : :
  271. : <define>BOOST_CHRONO_HEADER_ONLY
  272. <define>BOOST_ERROR_CODE_HEADER_ONLY
  273. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  274. <define>BOOST_CHRONO_VERSION=2
  275. : $(sources[1]:B)_h ]
  276. [ run $(sources)
  277. : :
  278. : <define>BOOST_CHRONO_HEADER_ONLY
  279. <define>BOOST_ERROR_CODE_HEADER_ONLY
  280. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  281. : v1_$(sources[1]:B)_h ]
  282. ;
  283. }
  284. rule chrono-run-header2 ( sources : name )
  285. {
  286. return
  287. [ run $(sources)
  288. : :
  289. : <define>BOOST_CHRONO_HEADER_ONLY
  290. <define>BOOST_ERROR_CODE_HEADER_ONLY
  291. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  292. <define>BOOST_CHRONO_VERSION=2
  293. : $(name)_h ]
  294. ;
  295. }
  296. rule chrono-compile ( sources )
  297. {
  298. return
  299. [ compile $(sources)
  300. :
  301. <define>BOOST_CHRONO_VERSION=2
  302. : $(sources[1]:B)_l ]
  303. [ compile $(sources)
  304. : <define>BOOST_CHRONO_HEADER_ONLY
  305. <define>BOOST_ERROR_CODE_HEADER_ONLY
  306. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  307. <define>BOOST_CHRONO_VERSION=2
  308. : $(sources[1]:B)_h ]
  309. ;
  310. }
  311. rule chrono-compile2 ( sources : name )
  312. {
  313. return
  314. [ compile $(sources)
  315. :
  316. <define>BOOST_CHRONO_VERSION=2
  317. : $(name)_l ]
  318. [ compile $(sources)
  319. : <define>BOOST_CHRONO_HEADER_ONLY
  320. <define>BOOST_ERROR_CODE_HEADER_ONLY
  321. #<define>BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
  322. <define>BOOST_CHRONO_VERSION=2
  323. : $(name)_h ]
  324. ;
  325. }
  326. test-suite "examples"
  327. :
  328. [ chrono-run-header ../example/cycle_count.cpp ]
  329. [ chrono-run-header ../example/runtime_resolution.cpp ]
  330. [ chrono-run-header ../example/xtime.cpp ]
  331. [ chrono-run-header ../example/saturating.cpp ]
  332. [ chrono-run ../example/min_time_point.cpp ]
  333. [ chrono-run-header ../example/i_dont_like_the_default_duration_behavior.cpp ]
  334. [ chrono-run ../example/simulated_thread_interface_demo.cpp ]
  335. [ chrono-run-header ../example/timeval_demo.cpp ]
  336. [ chrono-run ../example/chrono_unit_test.cpp ]
  337. [ chrono-run-header ../example/explore_limits.cpp ]
  338. [ chrono-run-header ../example/test_duration.cpp ]
  339. [ chrono-run ../example/test_clock.cpp ]
  340. [ chrono-run-header ../example/miscellaneous.cpp ]
  341. [ chrono-run-header ../example/test_special_values.cpp ]
  342. [ chrono-run ../example/manipulate_clock_object.cpp ]
  343. [ chrono-run-mt ../example/test_thread_clock.cpp ]
  344. [ chrono-run-header ../example/rounding.cpp ]
  345. #[ chrono-run ../example/await_keystroke.cpp ]
  346. ;
  347. test-suite "traits"
  348. :
  349. [ chrono-compile2 traits/common_type_duration_pass.cpp : traits_common_type_duration_p ]
  350. [ chrono-compile2 traits/common_type_time_point_pass.cpp : traits_common_type_time_point_p ]
  351. [ chrono-compile2 traits/treat_as_floating_point_pass.cpp : traits_treat_as_floating_point_p ]
  352. [ chrono-run-header2 traits/duration_values_pass.cpp : traits_duration_values_p ]
  353. ;
  354. test-suite "duration"
  355. :
  356. [ compile-fail duration/duration_duration_fail.cpp ]
  357. [ compile-fail duration/ratio_fail.cpp ]
  358. [ compile-fail duration/positive_num_fail.cpp ]
  359. [ chrono-compile duration/default_ratio_pass.cpp ]
  360. [ chrono-compile duration/types_pass.cpp ]
  361. [ chrono-compile duration/ratio_alias_pass.cpp ]
  362. [ chrono-compile duration/typedefs_pass.cpp ]
  363. [ chrono-run-header duration/arithmetic_pass.cpp ]
  364. [ chrono-run-header duration/duration_cast_pass.cpp ]
  365. [ compile-fail duration/duration_cast_int_fail.cpp ]
  366. [ chrono-run-header duration/comparisons_pass.cpp ]
  367. [ chrono-run-header duration/constructor_pass.cpp ]
  368. [ compile-fail duration/cons/convert_float_to_int_fail.cpp ]
  369. [ compile-fail duration/cons/convert_inexact_fail.cpp ]
  370. [ compile-fail duration/cons/implicit_constructot_fail.cpp ]
  371. [ compile-fail duration/cons/non_implicit_convertible_rep_fail.cpp ]
  372. [ compile-fail duration/cons/treat_as_floating_point_Rep2_true_fail.cpp ]
  373. [ compile-fail duration/nonmember/divide_rep2_fail.cpp ]
  374. [ compile-fail duration/nonmember/modulus_rep2_fail.cpp ]
  375. [ compile-fail duration/nonmember/times_rep2_lhs_fail.cpp ]
  376. [ compile-fail duration/nonmember/times_rep2_rhs_fail.cpp ]
  377. [ chrono-run-header duration/duration_values_pass.cpp ]
  378. [ chrono-run-header duration/rounding_pass.cpp ]
  379. ;
  380. test-suite "time_point"
  381. :
  382. [ chrono-compile2 time_point/default_duration_pass.cpp : time_point_default_duration_p ]
  383. [ compile-fail time_point/not_duration_fail.cpp : : time_point_not_duration_f ]
  384. [ chrono-run-header2 time_point/arithmetic_pass.cpp : time_point_arithmetic_p ]
  385. [ chrono-run-header2 time_point/arithmetic_ext_pass.cpp : time_point_arithmetic_ext_p ]
  386. [ chrono-run-header2 time_point/time_point_cast_pass.cpp : time_point_time_point_cast_p ]
  387. [ compile-fail time_point/time_point_cast_int_fail.cpp : : time_point_time_point_cast_int_f ]
  388. [ chrono-run-header2 time_point/comparisons_pass.cpp : time_point_comparisons_p ]
  389. [ compile-fail time_point/comparisons/equal_fail.cpp : : time_point_equal_f ]
  390. [ compile-fail time_point/comparisons/less_fail.cpp : : time_point_less_f ]
  391. [ chrono-run-header2 time_point/constructor_pass.cpp : time_point_constructor_p ]
  392. [ compile-fail time_point/cons/implicit_fail.cpp : : time_point_implicit_f ]
  393. [ compile-fail time_point/cons/non_implicit_convertible_duration_fail.cpp : : time_point_non_implicit_convertible_duration_f ]
  394. [ chrono-run-header2 time_point/min_max_pass.cpp : time_point_min_max_p ]
  395. ;
  396. test-suite "clock"
  397. :
  398. [ chrono-run2-mt clock/clock_pass.cpp : clock_clock_p ]
  399. [ chrono-run2-mt one_obj.cpp another_obj.cpp : two_obj_p ]
  400. ;
  401. test-suite "io_ex"
  402. :
  403. [ chrono-v1-v2-run ../example/io_ex1.cpp ]
  404. [ chrono-v1-v2-run-header ../example/io_ex2.cpp ]
  405. [ chrono-v1-v2-run ../example/io_ex3.cpp ]
  406. [ chrono-v1-v2-run ../example/io_ex4.cpp ]
  407. [ chrono-v1-v2-run ../example/io_ex5.cpp ]
  408. [ chrono-v1-v2-run ../example/french.cpp ]
  409. ;
  410. test-suite "io"
  411. :
  412. [ chrono-v1-v2-run-header io/duration_input.cpp ]
  413. [ chrono-v1-v2-run-header io/duration_output.cpp ]
  414. [ chrono-v1-v2-run-header io/time_point_input.cpp ]
  415. [ chrono-v1-v2-run-header io/time_point_output.cpp ]
  416. [ chrono-run test_7868.cpp ]
  417. [ chrono-run test_11006.cpp ]
  418. [ chrono-run test_11012.cpp ]
  419. [ chrono-runXXX test_12176.cpp ]
  420. ;
  421. test-suite "win32"
  422. :
  423. [ chrono-run win32_test.cpp ]
  424. ;
  425. explicit ts_ ;
  426. test-suite ts_
  427. :
  428. #[ chrono-run test_7868.cpp ]
  429. #[ chrono-run test_9337.cpp ]
  430. #[ chrono-run test_10778.cpp ]
  431. [ chrono-run test_10631.cpp ]
  432. ;