You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

387 lines
18 KiB

  1. # Copyright 2005-2013 Intel Corporation. All Rights Reserved.
  2. #
  3. # This file is part of Threading Building Blocks.
  4. #
  5. # Threading Building Blocks is free software; you can redistribute it
  6. # and/or modify it under the terms of the GNU General Public License
  7. # version 2 as published by the Free Software Foundation.
  8. #
  9. # Threading Building Blocks is distributed in the hope that it will be
  10. # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  11. # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with Threading Building Blocks; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. #
  18. # As a special exception, you may use this file as part of a free software
  19. # library without restriction. Specifically, if other files instantiate
  20. # templates or use macros or inline functions from this file, or you compile
  21. # this file and link it with other files to produce an executable, this
  22. # file does not by itself cause the resulting executable to be covered by
  23. # the GNU General Public License. This exception does not however
  24. # invalidate any other reasons why the executable file might be covered by
  25. # the GNU General Public License.
  26. #------------------------------------------------------------------------------
  27. # Define rules for making the TBB tests.
  28. #------------------------------------------------------------------------------
  29. .PHONY: default test_tbb_plain test_tbb_openmp test_tbb_cilk test_tbb_old clean
  30. default: test_tbb_plain test_tbb_openmp test_tbb_cilk test_tbb_old
  31. tbb_root ?= $(TBBROOT)
  32. BUILDING_PHASE=1
  33. TEST_RESOURCE = $(TBB.RES)
  34. include $(tbb_root)/build/common.inc
  35. DEBUG_SUFFIX=$(findstring _debug,$(call cross_cfg,_$(cfg)))
  36. #------------------------------------------------------------
  37. # Define static pattern rules dealing with .cpp source files
  38. #------------------------------------------------------------
  39. VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/rml/client $(tbb_root)/src/old $(tbb_root)/src/test $(tbb_root)/src/perf
  40. CPLUS_FLAGS += $(if $(crosstest),$(DEFINE_KEY)__TBB_NO_IMPLICIT_LINKAGE=1)
  41. ifdef use_proxy
  42. USE_PROXY_FLAG = $(DEFINE_KEY)HARNESS_USE_PROXY
  43. CPLUS_FLAGS += $(USE_PROXY_FLAG)
  44. LINK_TBB.LIB = $(PROXY.LIB)
  45. LIBS += $(LIBDL)
  46. endif
  47. include $(tbb_root)/build/common_rules.inc
  48. # Rule for generating executable test
  49. %.$(TEST_EXT): %.$(OBJ) $(TBB.LIB) $(if $(use_proxy),$(LINK_TBB.LIB))
  50. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(LINK_TBB.LIB) $(LIBS) $(AUX_LIBS) $(LINK_FLAGS)
  51. # Rules for generating a test DLL
  52. %_dll.$(DLL): %_dll.$(OBJ) $(TBB.LIB)
  53. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $(PIC_KEY) $< $(LINK_TBB.LIB) $(LIBS) $(LINK_FLAGS) $(DYLIB_KEY)
  54. .PRECIOUS: %_dll.$(OBJ) %_dll.$(DLL)
  55. # Rules for the tests, which use TBB in a dynamically loadable library
  56. test_model_plugin.$(TEST_EXT): CPLUS_FLAGS := $(CPLUS_FLAGS:$(USE_PROXY_FLAG)=)
  57. test_model_plugin.$(TEST_EXT): test_model_plugin.$(OBJ) test_model_plugin_dll.$(DLL)
  58. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(LIBDL) $(LIBS) $(LINK_FLAGS)
  59. # tbb_misc.$(OBJ) has to be specified here (instead of harness_inject_scheduler.h) because it carries dependency on version_string.ver
  60. SCHEDULER_DEPENDENCIES = $(TBB_ASM.OBJ) tbb_misc.$(OBJ)
  61. # These executables don't depend on the TBB library, but include core .cpp files directly
  62. SCHEDULER_DIRECTLY_INCLUDED = test_task_leaks.$(TEST_EXT) \
  63. test_task_assertions.$(TEST_EXT) \
  64. test_fast_random.$(TEST_EXT)
  65. # Necessary to locate version_string.ver referenced from directly included tbb_misc.cpp
  66. INCLUDES += $(INCLUDE_KEY).
  67. $(SCHEDULER_DIRECTLY_INCLUDED): WARNING_KEY += $(WARNING_SUPPRESS)
  68. $(SCHEDULER_DIRECTLY_INCLUDED): %.$(TEST_EXT) : %.$(OBJ) $(SCHEDULER_DEPENDENCIES)
  69. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $^ $(LIBDL) $(LIBS) $(LINK_FLAGS)
  70. # Tests that use some features of C++11
  71. TEST_TBB_CPP11 = test_lambda.$(TEST_EXT) test_cache_aligned_allocator_STL.$(TEST_EXT)
  72. $(TEST_TBB_CPP11:%.$(TEST_EXT)=%.$(OBJ)): %.$(OBJ): %.cpp
  73. $(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS) $(CPP11_FLAGS) $(CXX_ONLY_FLAGS) $(CXX_WARN_SUPPRESS) $(INCLUDES) $<
  74. $(TEST_TBB_CPP11): %.$(TEST_EXT): %.$(OBJ) $(TBB.LIB) $(if $(use_proxy),$(LINK_TBB.LIB))
  75. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $(CPP11_FLAGS) $< $(LINK_TBB.LIB) $(LIBS) $(AUX_LIBS) $(LINK_FLAGS)
  76. # test_tbb_header detects "multiple definition" linker error using the test that covers the whole library
  77. TWICE_LINKED_TESTS = test_tbb_header.$(TEST_EXT) \
  78. test_concurrent_unordered.$(TEST_EXT)
  79. %_secondary.$(OBJ): CPLUS_FLAGS+=$(DEFINE_KEY)__TBB_TEST_SECONDARY=1
  80. %_secondary.$(OBJ): %.cpp
  81. $(CPLUS) $(OUTPUTOBJ_KEY)$@ $(COMPILE_ONLY) $(CPLUS_FLAGS) $(CXX_ONLY_FLAGS) $(CXX_WARN_SUPPRESS) $(INCLUDES) $<
  82. $(TWICE_LINKED_TESTS): %.$(TEST_EXT): %.$(OBJ) %_secondary.$(OBJ) $(TBB.LIB)
  83. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $*.$(OBJ) $*_secondary.$(OBJ) $(LINK_TBB.LIB) $(LIBS) $(AUX_LIBS) $(LINK_FLAGS)
  84. # Checks that TBB atomics work correctly in position independent code
  85. test_atomic_pic.$(TEST_EXT): test_atomic.cpp
  86. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $(PIC_KEY) $(CXX_ONLY_FLAGS) $(CXX_WARN_SUPPRESS) $(INCLUDES) $(DEFINE_KEY)__TBB_TEST_PIC=1 $< $(LINK_TBB.LIB) $(LIBS) $(AUX_LIBS) $(LINK_FLAGS)
  87. #Test of generic gcc port and icc intrinsics port
  88. %_compiler_builtins.$(TEST_EXT): CPLUS_FLAGS+=$(DEFINE_KEY)__TBB_TEST_BUILTINS=1
  89. %_compiler_builtins.$(TEST_EXT): %.cpp
  90. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $(CXX_ONLY_FLAGS) $(CXX_WARN_SUPPRESS) $(INCLUDES) $< $(LIBS) $(AUX_LIBS) $(LINK_FLAGS)
  91. # The main list of TBB tests
  92. TEST_TBB_PLAIN.EXE = test_assembly.$(TEST_EXT) \
  93. test_tbb_fork.$(TEST_EXT) \
  94. test_assembly_compiler_builtins.$(TEST_EXT) \
  95. test_aligned_space.$(TEST_EXT) \
  96. test_atomic.$(TEST_EXT) \
  97. test_atomic_pic.$(TEST_EXT) \
  98. test_atomic_compiler_builtins.$(TEST_EXT) \
  99. test_blocked_range.$(TEST_EXT) \
  100. test_blocked_range2d.$(TEST_EXT) \
  101. test_blocked_range3d.$(TEST_EXT) \
  102. test_concurrent_queue.$(TEST_EXT) \
  103. test_concurrent_vector.$(TEST_EXT) \
  104. test_concurrent_unordered.$(TEST_EXT) \
  105. test_concurrent_hash_map.$(TEST_EXT) \
  106. test_enumerable_thread_specific.$(TEST_EXT) \
  107. test_handle_perror.$(TEST_EXT) \
  108. test_halt.$(TEST_EXT) \
  109. test_model_plugin.$(TEST_EXT) \
  110. test_mutex.$(TEST_EXT) \
  111. test_mutex_native_threads.$(TEST_EXT) \
  112. test_rwm_upgrade_downgrade.$(TEST_EXT) \
  113. test_cache_aligned_allocator.$(TEST_EXT) \
  114. test_parallel_for.$(TEST_EXT) \
  115. test_parallel_reduce.$(TEST_EXT) \
  116. test_parallel_sort.$(TEST_EXT) \
  117. test_parallel_scan.$(TEST_EXT) \
  118. test_parallel_while.$(TEST_EXT) \
  119. test_parallel_do.$(TEST_EXT) \
  120. test_pipeline.$(TEST_EXT) \
  121. test_pipeline_with_tbf.$(TEST_EXT) \
  122. test_parallel_pipeline.$(TEST_EXT) \
  123. test_task_scheduler_init.$(TEST_EXT) \
  124. test_task_scheduler_observer.$(TEST_EXT) \
  125. test_task.$(TEST_EXT) \
  126. test_tbb_thread.$(TEST_EXT) \
  127. test_std_thread.$(TEST_EXT) \
  128. test_tick_count.$(TEST_EXT) \
  129. test_inits_loop.$(TEST_EXT) \
  130. test_yield.$(TEST_EXT) \
  131. test_eh_tasks.$(TEST_EXT) \
  132. test_eh_algorithms.$(TEST_EXT) \
  133. test_eh_flow_graph.$(TEST_EXT) \
  134. test_parallel_invoke.$(TEST_EXT) \
  135. test_task_group.$(TEST_EXT) \
  136. test_ittnotify.$(TEST_EXT) \
  137. test_parallel_for_each.$(TEST_EXT) \
  138. test_tbb_header.$(TEST_EXT) \
  139. test_combinable.$(TEST_EXT) \
  140. test_task_auto_init.$(TEST_EXT) \
  141. test_task_arena.$(TEST_EXT) \
  142. test_concurrent_monitor.$(TEST_EXT) \
  143. test_semaphore.$(TEST_EXT) \
  144. test_critical_section.$(TEST_EXT) \
  145. test_reader_writer_lock.$(TEST_EXT) \
  146. test_tbb_condition_variable.$(TEST_EXT) \
  147. test_intrusive_list.$(TEST_EXT) \
  148. test_concurrent_priority_queue.$(TEST_EXT) \
  149. test_task_priority.$(TEST_EXT) \
  150. test_task_enqueue.$(TEST_EXT) \
  151. test_task_steal_limit.$(TEST_EXT) \
  152. test_hw_concurrency.$(TEST_EXT) \
  153. test_fp.$(TEST_EXT) \
  154. test_flow_graph.$(TEST_EXT) \
  155. test_broadcast_node.$(TEST_EXT) \
  156. test_continue_node.$(TEST_EXT) \
  157. test_function_node.$(TEST_EXT) \
  158. test_limiter_node.$(TEST_EXT) \
  159. test_join_node.$(TEST_EXT) \
  160. test_buffer_node.$(TEST_EXT) \
  161. test_queue_node.$(TEST_EXT) \
  162. test_priority_queue_node.$(TEST_EXT) \
  163. test_sequencer_node.$(TEST_EXT) \
  164. test_source_node.$(TEST_EXT) \
  165. test_overwrite_node.$(TEST_EXT) \
  166. test_write_once_node.$(TEST_EXT) \
  167. test_or_node.$(TEST_EXT) \
  168. test_multifunction_node.$(TEST_EXT) \
  169. test_split_node.$(TEST_EXT) \
  170. test_static_assert.$(TEST_EXT) \
  171. test_tbb_version.$(TEST_EXT) # insert new files right above
  172. TEST_TBB_PLAIN.EXE += $(TEST_TBB_CPP11)
  173. ifdef OPENMP_FLAG
  174. test_openmp.$(TEST_EXT): test_openmp.cpp
  175. $(CPLUS) $(OPENMP_FLAG) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $(INCLUDES) $< $(LIBS) $(LINK_TBB.LIB) $(LINK_FLAGS)
  176. test_tbb_openmp: $(TEST_PREREQUISITE) test_openmp.$(TEST_EXT)
  177. $(run_cmd) ./test_openmp.$(TEST_EXT) 1:4
  178. else
  179. test_tbb_openmp:
  180. @echo "OpenMP is not available"
  181. endif
  182. ifdef CILK_AVAILABLE
  183. test_cilk_dynamic_load.$(TEST_EXT): test_cilk_dynamic_load.$(OBJ) test_cilk_dynamic_load_dll.$(DLL)
  184. $(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $< $(LINK_TBB.LIB) $(LIBDL) $(LIBS) $(LINK_FLAGS)
  185. # Workaround on cilkrts linkage known issue (see Intel(R) C++ Composer XE 2011 Release Notes)
  186. # The issue reveals itself if a version of binutils is prior to 2.17
  187. ifeq (linux_icc,$(tbb_os)_$(compiler))
  188. test_cilk_interop.$(TEST_EXT): LIBS += -lcilkrts
  189. endif
  190. test_tbb_cilk: test_cilk_interop.$(TEST_EXT) test_cilk_dynamic_load.$(TEST_EXT)
  191. $(run_cmd) ./test_cilk_interop.$(TEST_EXT) $(args)
  192. $(run_cmd) ./test_cilk_dynamic_load.$(TEST_EXT) $(args)
  193. else
  194. test_tbb_cilk:
  195. @echo "Intel(R) Cilk Plus is not available"
  196. endif
  197. $(TEST_TBB_PLAIN.EXE): WARNING_KEY += $(TEST_WARNING_KEY)
  198. # Run tests that are in SCHEDULER_DIRECTLY_INCLUDED and TEST_TBB_PLAIN.EXE
  199. # Note that usually run_cmd is empty, and tests run directly
  200. test_tbb_plain: $(TEST_PREREQUISITE) $(SCHEDULER_DIRECTLY_INCLUDED) $(TEST_TBB_PLAIN.EXE)
  201. $(run_cmd) ./test_tbb_version.$(TEST_EXT) $(args)
  202. # Checking TBB version first to make sure the following testing has anything in it
  203. $(run_cmd) ./test_assembly.$(TEST_EXT) $(args)
  204. $(run_cmd) ./test_atomic.$(TEST_EXT) $(args)
  205. $(run_cmd) ./test_atomic_pic.$(TEST_EXT) $(args)
  206. # Yes, 4:8 is intended on the next line.
  207. $(run_cmd) ./test_yield.$(TEST_EXT) $(args) 4:8
  208. $(run_cmd) ./test_handle_perror.$(TEST_EXT) $(args)
  209. $(run_cmd) ./test_task_auto_init.$(TEST_EXT) $(args)
  210. $(run_cmd) ./test_task_arena.$(TEST_EXT) $(args)
  211. $(run_cmd) ./test_task_scheduler_init.$(TEST_EXT) $(args) 1:4
  212. $(run_cmd) ./test_task_scheduler_observer.$(TEST_EXT) $(args) 1:4
  213. $(run_cmd) ./test_task.$(TEST_EXT) $(args) 1:4
  214. $(run_cmd) ./test_task_assertions.$(TEST_EXT) $(args)
  215. $(run_cmd) ./test_task_leaks.$(TEST_EXT) $(args)
  216. $(run_cmd) ./test_fast_random.$(TEST_EXT) $(args) 1:16
  217. $(run_cmd) ./test_eh_tasks.$(TEST_EXT) $(args) 2:4
  218. $(run_cmd) ./test_cache_aligned_allocator.$(TEST_EXT) $(args)
  219. $(run_cmd) ./test_cache_aligned_allocator_STL.$(TEST_EXT) $(args)
  220. $(run_cmd) ./test_blocked_range.$(TEST_EXT) $(args) 1:4
  221. $(run_cmd) ./test_blocked_range2d.$(TEST_EXT) $(args) 1:4
  222. $(run_cmd) ./test_blocked_range3d.$(TEST_EXT) $(args) 1:4
  223. $(run_cmd) ./test_parallel_for.$(TEST_EXT) $(args) 1:4
  224. $(run_cmd) ./test_parallel_sort.$(TEST_EXT) $(args) 1:4
  225. $(run_cmd) ./test_aligned_space.$(TEST_EXT) $(args)
  226. $(run_cmd) ./test_parallel_reduce.$(TEST_EXT) $(args) 1:4
  227. $(run_cmd) ./test_parallel_scan.$(TEST_EXT) $(args) 1:4
  228. $(run_cmd) ./test_parallel_while.$(TEST_EXT) $(args) 1:4
  229. $(run_cmd) ./test_parallel_do.$(TEST_EXT) $(args) 1:4
  230. $(run_cmd) ./test_inits_loop.$(TEST_EXT) $(args)
  231. $(run_cmd) ./test_lambda.$(TEST_EXT) $(args) 1:4
  232. $(run_cmd) ./test_mutex.$(TEST_EXT) $(args) 1:3
  233. $(run_cmd) ./test_mutex_native_threads.$(TEST_EXT) $(args) 1:4
  234. $(run_cmd) ./test_rwm_upgrade_downgrade.$(TEST_EXT) $(args) 4
  235. # Yes, 4:8 is intended on the next line.
  236. $(run_cmd) ./test_halt.$(TEST_EXT) $(args) 4:8
  237. $(run_cmd) ./test_pipeline.$(TEST_EXT) $(args) 1:4
  238. $(run_cmd) ./test_pipeline_with_tbf.$(TEST_EXT) $(args) 1:4
  239. $(run_cmd) ./test_parallel_pipeline.$(TEST_EXT) $(args) 1:4
  240. $(run_cmd) ./test_tick_count.$(TEST_EXT) $(args) 1:4
  241. $(run_cmd) ./test_concurrent_queue.$(TEST_EXT) $(args) 1:4
  242. $(run_cmd) ./test_concurrent_vector.$(TEST_EXT) $(args) 1:4
  243. $(run_cmd) ./test_concurrent_unordered.$(TEST_EXT) $(args)
  244. $(run_cmd) ./test_concurrent_hash_map.$(TEST_EXT) $(args) 1:4
  245. $(run_cmd) ./test_enumerable_thread_specific.$(TEST_EXT) $(args) 0:4
  246. $(run_cmd) ./test_combinable.$(TEST_EXT) $(args) 0:4
  247. $(run_cmd) ./test_model_plugin.$(TEST_EXT) $(args) 4
  248. $(run_cmd) ./test_eh_algorithms.$(TEST_EXT) $(args) 2:4
  249. $(run_cmd) ./test_eh_flow_graph.$(TEST_EXT) $(args) 2:4
  250. $(run_cmd) ./test_tbb_thread.$(TEST_EXT) $(args)
  251. $(run_cmd) ./test_std_thread.$(TEST_EXT) $(args)
  252. $(run_cmd) ./test_parallel_invoke.$(TEST_EXT) $(args) 1:4
  253. $(run_cmd) ./test_task_group.$(TEST_EXT) $(args) 1:4
  254. $(run_cmd) ./test_ittnotify.$(TEST_EXT) $(args) 2:2
  255. $(run_cmd) ./test_parallel_for_each.$(TEST_EXT) $(args) 1:4
  256. $(run_cmd) ./test_tbb_header.$(TEST_EXT) $(args)
  257. $(run_cmd) ./test_concurrent_monitor.$(TEST_EXT) $(args) 6:8
  258. $(run_cmd) ./test_critical_section.$(TEST_EXT) $(args) 1:4
  259. $(run_cmd) ./test_semaphore.$(TEST_EXT) $(args) 1:4
  260. $(run_cmd) ./test_reader_writer_lock.$(TEST_EXT) $(args) 1:4
  261. $(run_cmd) ./test_tbb_condition_variable.$(TEST_EXT) $(args) 1:4
  262. $(run_cmd) ./test_tbb_fork.$(TEST_EXT)
  263. $(run_cmd) ./test_intrusive_list.$(TEST_EXT) $(args)
  264. $(run_cmd) ./test_concurrent_priority_queue.$(TEST_EXT) $(args) 1:4
  265. $(run_cmd) ./test_task_priority.$(TEST_EXT) $(args)
  266. $(run_cmd) ./test_task_enqueue.$(TEST_EXT) $(args) 1:4
  267. $(run_cmd) ./test_task_steal_limit.$(TEST_EXT) $(args)
  268. $(run_cmd) ./test_hw_concurrency.$(TEST_EXT) $(args)
  269. $(run_cmd) ./test_fp.$(TEST_EXT) $(args)
  270. $(run_cmd) ./test_flow_graph.$(TEST_EXT) $(args) 1:4
  271. $(run_cmd) ./test_broadcast_node.$(TEST_EXT) $(args) 1:4
  272. $(run_cmd) ./test_continue_node.$(TEST_EXT) $(args) 1:4
  273. $(run_cmd) ./test_function_node.$(TEST_EXT) $(args) 1:4
  274. $(run_cmd) ./test_limiter_node.$(TEST_EXT) $(args) 1:4
  275. $(run_cmd) ./test_join_node.$(TEST_EXT) $(args) 1:4
  276. $(run_cmd) ./test_buffer_node.$(TEST_EXT) $(args) 1:4
  277. $(run_cmd) ./test_queue_node.$(TEST_EXT) $(args) 1:4
  278. $(run_cmd) ./test_priority_queue_node.$(TEST_EXT) $(args) 1:4
  279. $(run_cmd) ./test_sequencer_node.$(TEST_EXT) $(args) 1:4
  280. $(run_cmd) ./test_source_node.$(TEST_EXT) $(args) 1:4
  281. $(run_cmd) ./test_overwrite_node.$(TEST_EXT) $(args) 1:4
  282. $(run_cmd) ./test_write_once_node.$(TEST_EXT) $(args) 1:4
  283. $(run_cmd) ./test_or_node.$(TEST_EXT) $(args) 1:4
  284. $(run_cmd) ./test_multifunction_node.$(TEST_EXT) $(args) 1:4
  285. $(run_cmd) ./test_split_node.$(TEST_EXT) $(args) 1:4
  286. $(run_cmd) ./test_atomic_compiler_builtins.$(TEST_EXT) $(args)
  287. $(run_cmd) ./test_assembly_compiler_builtins.$(TEST_EXT) $(args)
  288. $(run_cmd) ./test_static_assert.$(TEST_EXT) $(args)
  289. CPLUS_FLAGS_DEPRECATED = $(DEFINE_KEY)TBB_DEPRECATED=1 $(subst $(WARNING_KEY),,$(CPLUS_FLAGS)) $(WARNING_SUPPRESS) $(INCLUDE_KEY)$(tbb_root)/src/test
  290. TEST_TBB_OLD.OBJ = test_concurrent_vector_v2.$(OBJ) test_concurrent_queue_v2.$(OBJ) test_mutex_v2.$(OBJ) test_task_scheduler_observer_v3.$(OBJ)
  291. TEST_TBB_DEPRECATED.OBJ = test_concurrent_queue_deprecated.$(OBJ) \
  292. test_concurrent_vector_deprecated.$(OBJ) \
  293. # For deprecated files, we don't mind warnings etc., thus compilation rules are most relaxed
  294. $(TEST_TBB_OLD.OBJ): %.$(OBJ): %.cpp
  295. $(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS_DEPRECATED) $(CXX_ONLY_FLAGS) $(INCLUDES) $<
  296. %_deprecated.$(OBJ): %.cpp
  297. $(CPLUS) $(COMPILE_ONLY) $(OUTPUTOBJ_KEY)$@ $(CPLUS_FLAGS_DEPRECATED) $(CXX_ONLY_FLAGS) $(INCLUDES) $<
  298. .PRECIOUS: %_deprecated.$(OBJ)
  299. TEST_TBB_OLD.EXE = $(subst .$(OBJ),.$(TEST_EXT),$(TEST_TBB_OLD.OBJ) $(TEST_TBB_DEPRECATED.OBJ))
  300. ifeq (,$(NO_LEGACY_TESTS))
  301. test_tbb_old: $(TEST_PREREQUISITE) $(TEST_TBB_OLD.EXE)
  302. $(run_cmd) ./test_concurrent_vector_v2.$(TEST_EXT) $(args) 1:4
  303. $(run_cmd) ./test_concurrent_vector_deprecated.$(TEST_EXT) $(args) 1:4
  304. $(run_cmd) ./test_concurrent_queue_v2.$(TEST_EXT) $(args) 1:4
  305. $(run_cmd) ./test_concurrent_queue_deprecated.$(TEST_EXT) $(args) 1:4
  306. $(run_cmd) ./test_mutex_v2.$(TEST_EXT) $(args) 1
  307. $(run_cmd) ./test_mutex_v2.$(TEST_EXT) $(args) 2
  308. $(run_cmd) ./test_mutex_v2.$(TEST_EXT) $(args) 4
  309. $(run_cmd) ./test_task_scheduler_observer_v3.$(TEST_EXT) $(args) 1:4
  310. else
  311. test_tbb_old:
  312. @echo Legacy tests skipped
  313. endif
  314. ifneq (,$(codecov))
  315. codecov_gen:
  316. profmerge
  317. codecov $(if $(findstring -,$(codecov)),$(codecov),) -demang -comp $(tbb_root)/build/codecov.txt
  318. endif
  319. test_% debug_%: test_%.$(TEST_EXT) $(TEST_PREREQUISITE)
  320. ifeq (,$(repeat))
  321. $(run_cmd) ./$< $(args)
  322. else
  323. ifeq (windows,$(tbb_os))
  324. for /L %%i in (1,1,$(repeat)) do echo %%i of $(repeat): && $(run_cmd) $< $(args)
  325. else
  326. for ((i=1;i<=$(repeat);++i)); do echo $$i of $(repeat): && $(run_cmd) ./$< $(args); done
  327. endif
  328. endif # repeat
  329. ifneq (,$(codecov))
  330. profmerge
  331. codecov $(if $(findstring -,$(codecov)),$(codecov),) -demang -comp $(tbb_root)/build/codecov.txt
  332. endif
  333. time_%: time_%.$(TEST_EXT) $(TEST_PREREQUISITE)
  334. $(run_cmd) ./$< $(args)
  335. perf_%: AUX_LIBS = perf_dll.$(LIBEXT)
  336. perf_%: perf_dll.$(DLL) perf_%.$(TEST_EXT)
  337. $(run_cmd) ./$@.$(TEST_EXT) $(args)
  338. clean_%:
  339. $(RM) $*.$(OBJ) $*.exe $*.$(DLL) $*.$(LIBEXT) $*.res $*.map $*.ilk $*.pdb $*.exp $*.*manifest $*.tmp $*.d *.ver
  340. clean:
  341. $(RM) *.$(OBJ) *.exe *.$(DLL) *.$(LIBEXT) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d pgopti.* *.dyn core core.*[0-9][0-9] *.ver
  342. # Include automatically generated dependences
  343. -include *.d