BUILD.bazel 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111
  1. #
  2. # Copyright 2017 The Abseil Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # https://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. load(
  17. "//absl:copts/configure_copts.bzl",
  18. "ABSL_DEFAULT_COPTS",
  19. "ABSL_DEFAULT_LINKOPTS",
  20. "ABSL_TEST_COPTS",
  21. )
  22. package(
  23. default_visibility = ["//visibility:public"],
  24. features = [
  25. "header_modules",
  26. "layering_check",
  27. "parse_headers",
  28. ],
  29. )
  30. licenses(["notice"])
  31. cc_library(
  32. name = "compressed_tuple",
  33. hdrs = ["internal/compressed_tuple.h"],
  34. copts = ABSL_DEFAULT_COPTS,
  35. linkopts = ABSL_DEFAULT_LINKOPTS,
  36. deps = [
  37. "//absl/utility",
  38. ],
  39. )
  40. cc_test(
  41. name = "compressed_tuple_test",
  42. srcs = ["internal/compressed_tuple_test.cc"],
  43. copts = ABSL_TEST_COPTS,
  44. linkopts = ABSL_DEFAULT_LINKOPTS,
  45. deps = [
  46. ":compressed_tuple",
  47. ":test_instance_tracker",
  48. "//absl/memory",
  49. "//absl/types:any",
  50. "//absl/types:optional",
  51. "//absl/utility",
  52. "@com_google_googletest//:gtest",
  53. "@com_google_googletest//:gtest_main",
  54. ],
  55. )
  56. cc_library(
  57. name = "fixed_array",
  58. hdrs = ["fixed_array.h"],
  59. copts = ABSL_DEFAULT_COPTS,
  60. linkopts = ABSL_DEFAULT_LINKOPTS,
  61. deps = [
  62. ":compressed_tuple",
  63. "//absl/algorithm",
  64. "//absl/base:config",
  65. "//absl/base:core_headers",
  66. "//absl/base:dynamic_annotations",
  67. "//absl/base:throw_delegate",
  68. "//absl/memory",
  69. ],
  70. )
  71. cc_test(
  72. name = "fixed_array_test",
  73. srcs = ["fixed_array_test.cc"],
  74. copts = ABSL_TEST_COPTS,
  75. linkopts = ABSL_DEFAULT_LINKOPTS,
  76. deps = [
  77. ":fixed_array",
  78. ":test_allocator",
  79. "//absl/base:config",
  80. "//absl/base:exception_testing",
  81. "//absl/hash:hash_testing",
  82. "//absl/memory",
  83. "@com_google_googletest//:gtest",
  84. "@com_google_googletest//:gtest_main",
  85. ],
  86. )
  87. cc_test(
  88. name = "fixed_array_exception_safety_test",
  89. srcs = ["fixed_array_exception_safety_test.cc"],
  90. copts = ABSL_TEST_COPTS,
  91. linkopts = ABSL_DEFAULT_LINKOPTS,
  92. deps = [
  93. ":fixed_array",
  94. "//absl/base:config",
  95. "//absl/base:exception_safety_testing",
  96. "@com_google_googletest//:gtest",
  97. "@com_google_googletest//:gtest_main",
  98. ],
  99. )
  100. cc_binary(
  101. name = "fixed_array_benchmark",
  102. testonly = True,
  103. srcs = ["fixed_array_benchmark.cc"],
  104. copts = ABSL_TEST_COPTS + ["$(STACK_FRAME_UNLIMITED)"],
  105. linkopts = ABSL_DEFAULT_LINKOPTS,
  106. tags = ["benchmark"],
  107. deps = [
  108. ":fixed_array",
  109. "@com_github_google_benchmark//:benchmark_main",
  110. ],
  111. )
  112. cc_library(
  113. name = "inlined_vector_internal",
  114. hdrs = ["internal/inlined_vector.h"],
  115. copts = ABSL_DEFAULT_COPTS,
  116. linkopts = ABSL_DEFAULT_LINKOPTS,
  117. deps = [
  118. ":compressed_tuple",
  119. "//absl/base:base_internal",
  120. "//absl/base:config",
  121. "//absl/base:core_headers",
  122. "//absl/memory",
  123. "//absl/meta:type_traits",
  124. "//absl/types:span",
  125. ],
  126. )
  127. cc_library(
  128. name = "inlined_vector",
  129. hdrs = ["inlined_vector.h"],
  130. copts = ABSL_DEFAULT_COPTS,
  131. linkopts = ABSL_DEFAULT_LINKOPTS,
  132. deps = [
  133. ":inlined_vector_internal",
  134. "//absl/algorithm",
  135. "//absl/base:core_headers",
  136. "//absl/base:throw_delegate",
  137. "//absl/memory",
  138. "//absl/meta:type_traits",
  139. ],
  140. )
  141. cc_library(
  142. name = "test_allocator",
  143. testonly = True,
  144. copts = ABSL_TEST_COPTS,
  145. linkopts = ABSL_DEFAULT_LINKOPTS,
  146. textual_hdrs = ["internal/test_allocator.h"],
  147. visibility = ["//visibility:private"],
  148. )
  149. cc_test(
  150. name = "inlined_vector_test",
  151. srcs = ["inlined_vector_test.cc"],
  152. copts = ABSL_TEST_COPTS,
  153. linkopts = ABSL_DEFAULT_LINKOPTS,
  154. deps = [
  155. ":inlined_vector",
  156. ":test_allocator",
  157. ":test_instance_tracker",
  158. "//absl/base:config",
  159. "//absl/base:core_headers",
  160. "//absl/base:exception_testing",
  161. "//absl/hash:hash_testing",
  162. "//absl/log:check",
  163. "//absl/memory",
  164. "//absl/strings",
  165. "@com_google_googletest//:gtest",
  166. "@com_google_googletest//:gtest_main",
  167. ],
  168. )
  169. cc_binary(
  170. name = "inlined_vector_benchmark",
  171. testonly = True,
  172. srcs = ["inlined_vector_benchmark.cc"],
  173. copts = ABSL_TEST_COPTS,
  174. linkopts = ABSL_DEFAULT_LINKOPTS,
  175. tags = ["benchmark"],
  176. deps = [
  177. ":inlined_vector",
  178. "//absl/base:core_headers",
  179. "//absl/base:raw_logging_internal",
  180. "//absl/strings",
  181. "@com_github_google_benchmark//:benchmark_main",
  182. ],
  183. )
  184. cc_test(
  185. name = "inlined_vector_exception_safety_test",
  186. srcs = ["inlined_vector_exception_safety_test.cc"],
  187. copts = ABSL_TEST_COPTS,
  188. deps = [
  189. ":inlined_vector",
  190. "//absl/base:config",
  191. "//absl/base:exception_safety_testing",
  192. "@com_google_googletest//:gtest",
  193. "@com_google_googletest//:gtest_main",
  194. ],
  195. )
  196. cc_library(
  197. name = "test_instance_tracker",
  198. testonly = True,
  199. srcs = ["internal/test_instance_tracker.cc"],
  200. hdrs = ["internal/test_instance_tracker.h"],
  201. copts = ABSL_DEFAULT_COPTS,
  202. linkopts = ABSL_DEFAULT_LINKOPTS,
  203. visibility = [
  204. "//absl:__subpackages__",
  205. ],
  206. deps = ["//absl/types:compare"],
  207. )
  208. cc_test(
  209. name = "test_instance_tracker_test",
  210. srcs = ["internal/test_instance_tracker_test.cc"],
  211. copts = ABSL_TEST_COPTS,
  212. linkopts = ABSL_DEFAULT_LINKOPTS,
  213. deps = [
  214. ":test_instance_tracker",
  215. "@com_google_googletest//:gtest",
  216. "@com_google_googletest//:gtest_main",
  217. ],
  218. )
  219. NOTEST_TAGS_MOBILE = [
  220. "no_test_android_arm",
  221. "no_test_android_arm64",
  222. "no_test_android_x86",
  223. "no_test_ios_x86_64",
  224. ]
  225. cc_library(
  226. name = "flat_hash_map",
  227. hdrs = ["flat_hash_map.h"],
  228. copts = ABSL_DEFAULT_COPTS,
  229. linkopts = ABSL_DEFAULT_LINKOPTS,
  230. deps = [
  231. ":container_memory",
  232. ":hash_container_defaults",
  233. ":raw_hash_map",
  234. "//absl/algorithm:container",
  235. "//absl/base:core_headers",
  236. "//absl/memory",
  237. ],
  238. )
  239. cc_test(
  240. name = "flat_hash_map_test",
  241. srcs = ["flat_hash_map_test.cc"],
  242. copts = ABSL_TEST_COPTS,
  243. linkopts = ABSL_DEFAULT_LINKOPTS,
  244. tags = ["no_test_loonix"],
  245. deps = [
  246. ":flat_hash_map",
  247. ":hash_generator_testing",
  248. ":test_allocator",
  249. ":unordered_map_constructor_test",
  250. ":unordered_map_lookup_test",
  251. ":unordered_map_members_test",
  252. ":unordered_map_modifiers_test",
  253. "//absl/log:check",
  254. "//absl/meta:type_traits",
  255. "//absl/types:any",
  256. "@com_google_googletest//:gtest",
  257. "@com_google_googletest//:gtest_main",
  258. ],
  259. )
  260. cc_library(
  261. name = "flat_hash_set",
  262. hdrs = ["flat_hash_set.h"],
  263. copts = ABSL_DEFAULT_COPTS,
  264. linkopts = ABSL_DEFAULT_LINKOPTS,
  265. deps = [
  266. ":container_memory",
  267. ":hash_container_defaults",
  268. ":raw_hash_set",
  269. "//absl/algorithm:container",
  270. "//absl/base:core_headers",
  271. "//absl/memory",
  272. ],
  273. )
  274. cc_test(
  275. name = "flat_hash_set_test",
  276. srcs = ["flat_hash_set_test.cc"],
  277. copts = ABSL_TEST_COPTS + ["-DUNORDERED_SET_CXX17"],
  278. linkopts = ABSL_DEFAULT_LINKOPTS,
  279. tags = ["no_test_loonix"],
  280. deps = [
  281. ":container_memory",
  282. ":flat_hash_set",
  283. ":hash_generator_testing",
  284. ":test_allocator",
  285. ":unordered_set_constructor_test",
  286. ":unordered_set_lookup_test",
  287. ":unordered_set_members_test",
  288. ":unordered_set_modifiers_test",
  289. "//absl/base:config",
  290. "//absl/log:check",
  291. "//absl/memory",
  292. "//absl/strings",
  293. "@com_google_googletest//:gtest",
  294. "@com_google_googletest//:gtest_main",
  295. ],
  296. )
  297. cc_library(
  298. name = "node_hash_map",
  299. hdrs = ["node_hash_map.h"],
  300. copts = ABSL_DEFAULT_COPTS,
  301. linkopts = ABSL_DEFAULT_LINKOPTS,
  302. deps = [
  303. ":container_memory",
  304. ":hash_container_defaults",
  305. ":node_slot_policy",
  306. ":raw_hash_map",
  307. "//absl/algorithm:container",
  308. "//absl/base:core_headers",
  309. "//absl/memory",
  310. ],
  311. )
  312. cc_test(
  313. name = "node_hash_map_test",
  314. srcs = ["node_hash_map_test.cc"],
  315. copts = ABSL_TEST_COPTS,
  316. linkopts = ABSL_DEFAULT_LINKOPTS,
  317. tags = ["no_test_loonix"],
  318. deps = [
  319. ":hash_generator_testing",
  320. ":node_hash_map",
  321. ":tracked",
  322. ":unordered_map_constructor_test",
  323. ":unordered_map_lookup_test",
  324. ":unordered_map_members_test",
  325. ":unordered_map_modifiers_test",
  326. "@com_google_googletest//:gtest",
  327. "@com_google_googletest//:gtest_main",
  328. ],
  329. )
  330. cc_library(
  331. name = "node_hash_set",
  332. hdrs = ["node_hash_set.h"],
  333. copts = ABSL_DEFAULT_COPTS,
  334. linkopts = ABSL_DEFAULT_LINKOPTS,
  335. deps = [
  336. ":container_memory",
  337. ":hash_container_defaults",
  338. ":node_slot_policy",
  339. ":raw_hash_set",
  340. "//absl/algorithm:container",
  341. "//absl/base:core_headers",
  342. "//absl/memory",
  343. ],
  344. )
  345. cc_test(
  346. name = "node_hash_set_test",
  347. srcs = ["node_hash_set_test.cc"],
  348. copts = ABSL_TEST_COPTS + ["-DUNORDERED_SET_CXX17"],
  349. linkopts = ABSL_DEFAULT_LINKOPTS,
  350. tags = ["no_test_loonix"],
  351. deps = [
  352. ":node_hash_set",
  353. ":unordered_set_constructor_test",
  354. ":unordered_set_lookup_test",
  355. ":unordered_set_members_test",
  356. ":unordered_set_modifiers_test",
  357. "@com_google_googletest//:gtest",
  358. "@com_google_googletest//:gtest_main",
  359. ],
  360. )
  361. cc_library(
  362. name = "container_memory",
  363. hdrs = ["internal/container_memory.h"],
  364. copts = ABSL_DEFAULT_COPTS,
  365. linkopts = ABSL_DEFAULT_LINKOPTS,
  366. deps = [
  367. "//absl/base:config",
  368. "//absl/memory",
  369. "//absl/meta:type_traits",
  370. "//absl/utility",
  371. ],
  372. )
  373. cc_test(
  374. name = "container_memory_test",
  375. srcs = ["internal/container_memory_test.cc"],
  376. copts = ABSL_TEST_COPTS,
  377. linkopts = ABSL_DEFAULT_LINKOPTS,
  378. tags = ["no_test_loonix"],
  379. deps = [
  380. ":container_memory",
  381. ":test_instance_tracker",
  382. "//absl/base:no_destructor",
  383. "//absl/meta:type_traits",
  384. "//absl/strings",
  385. "@com_google_googletest//:gtest",
  386. "@com_google_googletest//:gtest_main",
  387. ],
  388. )
  389. cc_library(
  390. name = "hash_function_defaults",
  391. hdrs = ["internal/hash_function_defaults.h"],
  392. copts = ABSL_DEFAULT_COPTS,
  393. linkopts = ABSL_DEFAULT_LINKOPTS,
  394. visibility = [
  395. "//visibility:private",
  396. ],
  397. deps = [
  398. ":common",
  399. "//absl/base:config",
  400. "//absl/hash",
  401. "//absl/meta:type_traits",
  402. "//absl/strings",
  403. "//absl/strings:cord",
  404. ],
  405. )
  406. cc_library(
  407. name = "hash_container_defaults",
  408. hdrs = ["hash_container_defaults.h"],
  409. copts = ABSL_DEFAULT_COPTS,
  410. linkopts = ABSL_DEFAULT_LINKOPTS,
  411. deps = [
  412. ":hash_function_defaults",
  413. "//absl/base:config",
  414. ],
  415. )
  416. cc_test(
  417. name = "hash_function_defaults_test",
  418. srcs = ["internal/hash_function_defaults_test.cc"],
  419. copts = ABSL_TEST_COPTS,
  420. linkopts = ABSL_DEFAULT_LINKOPTS,
  421. tags = NOTEST_TAGS_MOBILE + ["no_test_loonix"],
  422. deps = [
  423. ":flat_hash_map",
  424. ":flat_hash_set",
  425. ":hash_function_defaults",
  426. "//absl/hash",
  427. "//absl/random",
  428. "//absl/strings",
  429. "//absl/strings:cord",
  430. "//absl/strings:cord_test_helpers",
  431. "@com_google_googletest//:gtest",
  432. "@com_google_googletest//:gtest_main",
  433. ],
  434. )
  435. cc_library(
  436. name = "hash_generator_testing",
  437. testonly = True,
  438. srcs = ["internal/hash_generator_testing.cc"],
  439. hdrs = ["internal/hash_generator_testing.h"],
  440. copts = ABSL_TEST_COPTS,
  441. linkopts = ABSL_DEFAULT_LINKOPTS,
  442. deps = [
  443. ":hash_policy_testing",
  444. "//absl/base:no_destructor",
  445. "//absl/memory",
  446. "//absl/meta:type_traits",
  447. "//absl/strings",
  448. ],
  449. )
  450. cc_library(
  451. name = "hash_policy_testing",
  452. testonly = True,
  453. hdrs = ["internal/hash_policy_testing.h"],
  454. copts = ABSL_TEST_COPTS,
  455. linkopts = ABSL_DEFAULT_LINKOPTS,
  456. deps = [
  457. "//absl/hash",
  458. "//absl/strings",
  459. ],
  460. )
  461. cc_test(
  462. name = "hash_policy_testing_test",
  463. srcs = ["internal/hash_policy_testing_test.cc"],
  464. copts = ABSL_TEST_COPTS,
  465. linkopts = ABSL_DEFAULT_LINKOPTS,
  466. deps = [
  467. ":hash_policy_testing",
  468. "@com_google_googletest//:gtest",
  469. "@com_google_googletest//:gtest_main",
  470. ],
  471. )
  472. cc_library(
  473. name = "hash_policy_traits",
  474. hdrs = ["internal/hash_policy_traits.h"],
  475. copts = ABSL_DEFAULT_COPTS,
  476. linkopts = ABSL_DEFAULT_LINKOPTS,
  477. deps = [
  478. ":common_policy_traits",
  479. "//absl/meta:type_traits",
  480. ],
  481. )
  482. cc_test(
  483. name = "hash_policy_traits_test",
  484. srcs = ["internal/hash_policy_traits_test.cc"],
  485. copts = ABSL_TEST_COPTS,
  486. linkopts = ABSL_DEFAULT_LINKOPTS,
  487. deps = [
  488. ":container_memory",
  489. ":hash_policy_traits",
  490. "@com_google_googletest//:gtest",
  491. "@com_google_googletest//:gtest_main",
  492. ],
  493. )
  494. cc_library(
  495. name = "common_policy_traits",
  496. hdrs = ["internal/common_policy_traits.h"],
  497. copts = ABSL_DEFAULT_COPTS,
  498. linkopts = ABSL_DEFAULT_LINKOPTS,
  499. visibility = ["//visibility:private"],
  500. deps = ["//absl/meta:type_traits"],
  501. )
  502. cc_test(
  503. name = "common_policy_traits_test",
  504. srcs = ["internal/common_policy_traits_test.cc"],
  505. copts = ABSL_TEST_COPTS,
  506. linkopts = ABSL_DEFAULT_LINKOPTS,
  507. deps = [
  508. ":common_policy_traits",
  509. "//absl/base:config",
  510. "@com_google_googletest//:gtest",
  511. "@com_google_googletest//:gtest_main",
  512. ],
  513. )
  514. cc_library(
  515. name = "hashtable_debug",
  516. hdrs = ["internal/hashtable_debug.h"],
  517. copts = ABSL_DEFAULT_COPTS,
  518. linkopts = ABSL_DEFAULT_LINKOPTS,
  519. deps = [
  520. ":hashtable_debug_hooks",
  521. ],
  522. )
  523. cc_library(
  524. name = "hashtable_debug_hooks",
  525. hdrs = ["internal/hashtable_debug_hooks.h"],
  526. copts = ABSL_DEFAULT_COPTS,
  527. linkopts = ABSL_DEFAULT_LINKOPTS,
  528. deps = [
  529. "//absl/base:config",
  530. ],
  531. )
  532. cc_library(
  533. name = "hashtablez_sampler",
  534. srcs = [
  535. "internal/hashtablez_sampler.cc",
  536. "internal/hashtablez_sampler_force_weak_definition.cc",
  537. ],
  538. hdrs = ["internal/hashtablez_sampler.h"],
  539. copts = ABSL_DEFAULT_COPTS,
  540. linkopts = ABSL_DEFAULT_LINKOPTS,
  541. deps = [
  542. "//absl/base",
  543. "//absl/base:config",
  544. "//absl/base:core_headers",
  545. "//absl/base:no_destructor",
  546. "//absl/base:raw_logging_internal",
  547. "//absl/debugging:stacktrace",
  548. "//absl/memory",
  549. "//absl/profiling:exponential_biased",
  550. "//absl/profiling:sample_recorder",
  551. "//absl/synchronization",
  552. "//absl/time",
  553. "//absl/utility",
  554. ],
  555. )
  556. cc_test(
  557. name = "hashtablez_sampler_test",
  558. srcs = ["internal/hashtablez_sampler_test.cc"],
  559. linkopts = ABSL_DEFAULT_LINKOPTS,
  560. tags = [
  561. "no_test_wasm",
  562. ],
  563. deps = [
  564. ":hashtablez_sampler",
  565. "//absl/base:config",
  566. "//absl/base:core_headers",
  567. "//absl/profiling:sample_recorder",
  568. "//absl/synchronization",
  569. "//absl/synchronization:thread_pool",
  570. "//absl/time",
  571. "@com_google_googletest//:gtest",
  572. "@com_google_googletest//:gtest_main",
  573. ],
  574. )
  575. cc_library(
  576. name = "node_slot_policy",
  577. hdrs = ["internal/node_slot_policy.h"],
  578. copts = ABSL_DEFAULT_COPTS,
  579. linkopts = ABSL_DEFAULT_LINKOPTS,
  580. deps = ["//absl/base:config"],
  581. )
  582. cc_test(
  583. name = "node_slot_policy_test",
  584. srcs = ["internal/node_slot_policy_test.cc"],
  585. copts = ABSL_TEST_COPTS,
  586. linkopts = ABSL_DEFAULT_LINKOPTS,
  587. deps = [
  588. ":hash_policy_traits",
  589. ":node_slot_policy",
  590. "//absl/base:config",
  591. "@com_google_googletest//:gtest",
  592. "@com_google_googletest//:gtest_main",
  593. ],
  594. )
  595. cc_library(
  596. name = "raw_hash_map",
  597. hdrs = ["internal/raw_hash_map.h"],
  598. copts = ABSL_DEFAULT_COPTS,
  599. linkopts = ABSL_DEFAULT_LINKOPTS,
  600. deps = [
  601. ":container_memory",
  602. ":raw_hash_set",
  603. "//absl/base:config",
  604. "//absl/base:core_headers",
  605. "//absl/base:throw_delegate",
  606. ],
  607. )
  608. cc_library(
  609. name = "common",
  610. hdrs = ["internal/common.h"],
  611. copts = ABSL_DEFAULT_COPTS,
  612. linkopts = ABSL_DEFAULT_LINKOPTS,
  613. deps = [
  614. "//absl/meta:type_traits",
  615. "//absl/types:optional",
  616. ],
  617. )
  618. cc_library(
  619. name = "raw_hash_set",
  620. srcs = ["internal/raw_hash_set.cc"],
  621. hdrs = ["internal/raw_hash_set.h"],
  622. copts = ABSL_DEFAULT_COPTS,
  623. linkopts = ABSL_DEFAULT_LINKOPTS,
  624. deps = [
  625. ":common",
  626. ":compressed_tuple",
  627. ":container_memory",
  628. ":hash_policy_traits",
  629. ":hashtable_debug_hooks",
  630. ":hashtablez_sampler",
  631. "//absl/base:config",
  632. "//absl/base:core_headers",
  633. "//absl/base:dynamic_annotations",
  634. "//absl/base:endian",
  635. "//absl/base:prefetch",
  636. "//absl/base:raw_logging_internal",
  637. "//absl/hash",
  638. "//absl/memory",
  639. "//absl/meta:type_traits",
  640. "//absl/numeric:bits",
  641. "//absl/utility",
  642. ],
  643. )
  644. cc_test(
  645. name = "raw_hash_set_test",
  646. srcs = ["internal/raw_hash_set_test.cc"],
  647. copts = ABSL_TEST_COPTS,
  648. linkstatic = 1,
  649. tags = NOTEST_TAGS_MOBILE + [
  650. "no_test_loonix",
  651. # TODO(b/237097643): investigate race and remove
  652. "noarm_gemu",
  653. ],
  654. deps = [
  655. ":container_memory",
  656. ":flat_hash_map",
  657. ":flat_hash_set",
  658. ":hash_function_defaults",
  659. ":hash_policy_testing",
  660. ":hashtable_debug",
  661. ":hashtablez_sampler",
  662. ":raw_hash_set",
  663. ":test_allocator",
  664. "//absl/base",
  665. "//absl/base:config",
  666. "//absl/base:core_headers",
  667. "//absl/base:prefetch",
  668. "//absl/functional:function_ref",
  669. "//absl/hash",
  670. "//absl/log",
  671. "//absl/log:check",
  672. "//absl/memory",
  673. "//absl/meta:type_traits",
  674. "//absl/strings",
  675. "@com_google_googletest//:gtest",
  676. "@com_google_googletest//:gtest_main",
  677. ],
  678. )
  679. cc_binary(
  680. name = "raw_hash_set_benchmark",
  681. testonly = True,
  682. srcs = ["internal/raw_hash_set_benchmark.cc"],
  683. copts = ABSL_TEST_COPTS,
  684. linkopts = ABSL_DEFAULT_LINKOPTS,
  685. tags = ["benchmark"],
  686. visibility = ["//visibility:private"],
  687. deps = [
  688. ":container_memory",
  689. ":hash_function_defaults",
  690. ":raw_hash_set",
  691. "//absl/base:raw_logging_internal",
  692. "//absl/random",
  693. "//absl/strings:str_format",
  694. "@com_github_google_benchmark//:benchmark_main",
  695. ],
  696. )
  697. cc_binary(
  698. name = "raw_hash_set_probe_benchmark",
  699. testonly = True,
  700. srcs = ["internal/raw_hash_set_probe_benchmark.cc"],
  701. copts = ABSL_TEST_COPTS,
  702. linkopts = select({
  703. "//conditions:default": [],
  704. }) + ABSL_DEFAULT_LINKOPTS,
  705. tags = ["benchmark"],
  706. visibility = ["//visibility:private"],
  707. deps = [
  708. ":flat_hash_map",
  709. ":hash_function_defaults",
  710. ":hashtable_debug",
  711. ":raw_hash_set",
  712. "//absl/base:no_destructor",
  713. "//absl/random",
  714. "//absl/random:distributions",
  715. "//absl/strings",
  716. "//absl/strings:str_format",
  717. "//absl/types:optional",
  718. ],
  719. )
  720. cc_test(
  721. name = "raw_hash_set_allocator_test",
  722. size = "small",
  723. srcs = ["internal/raw_hash_set_allocator_test.cc"],
  724. copts = ABSL_TEST_COPTS,
  725. linkopts = ABSL_DEFAULT_LINKOPTS,
  726. deps = [
  727. ":container_memory",
  728. ":raw_hash_set",
  729. ":tracked",
  730. "//absl/base:config",
  731. "@com_google_googletest//:gtest",
  732. "@com_google_googletest//:gtest_main",
  733. ],
  734. )
  735. cc_library(
  736. name = "layout",
  737. hdrs = ["internal/layout.h"],
  738. copts = ABSL_DEFAULT_COPTS,
  739. linkopts = ABSL_DEFAULT_LINKOPTS,
  740. deps = [
  741. "//absl/base:config",
  742. "//absl/base:core_headers",
  743. "//absl/debugging:demangle_internal",
  744. "//absl/meta:type_traits",
  745. "//absl/strings",
  746. "//absl/types:span",
  747. "//absl/utility",
  748. ],
  749. )
  750. cc_test(
  751. name = "layout_test",
  752. size = "small",
  753. srcs = ["internal/layout_test.cc"],
  754. copts = ABSL_TEST_COPTS,
  755. linkopts = ABSL_DEFAULT_LINKOPTS,
  756. tags = NOTEST_TAGS_MOBILE + ["no_test_loonix"],
  757. visibility = ["//visibility:private"],
  758. deps = [
  759. ":layout",
  760. "//absl/base:config",
  761. "//absl/log:check",
  762. "//absl/types:span",
  763. "//absl/utility",
  764. "@com_google_googletest//:gtest",
  765. "@com_google_googletest//:gtest_main",
  766. ],
  767. )
  768. cc_binary(
  769. name = "layout_benchmark",
  770. testonly = True,
  771. srcs = ["internal/layout_benchmark.cc"],
  772. copts = ABSL_TEST_COPTS,
  773. linkopts = ABSL_DEFAULT_LINKOPTS,
  774. tags = ["benchmark"],
  775. visibility = ["//visibility:private"],
  776. deps = [
  777. ":layout",
  778. "//absl/base:core_headers",
  779. "//absl/base:raw_logging_internal",
  780. "@com_github_google_benchmark//:benchmark_main",
  781. ],
  782. )
  783. cc_library(
  784. name = "tracked",
  785. testonly = True,
  786. hdrs = ["internal/tracked.h"],
  787. copts = ABSL_TEST_COPTS,
  788. linkopts = ABSL_DEFAULT_LINKOPTS,
  789. deps = [
  790. "//absl/base:config",
  791. ],
  792. )
  793. cc_library(
  794. name = "unordered_map_constructor_test",
  795. testonly = True,
  796. hdrs = ["internal/unordered_map_constructor_test.h"],
  797. copts = ABSL_TEST_COPTS,
  798. linkopts = ABSL_DEFAULT_LINKOPTS,
  799. deps = [
  800. ":hash_generator_testing",
  801. ":hash_policy_testing",
  802. "@com_google_googletest//:gtest",
  803. ],
  804. )
  805. cc_library(
  806. name = "unordered_map_lookup_test",
  807. testonly = True,
  808. hdrs = ["internal/unordered_map_lookup_test.h"],
  809. copts = ABSL_TEST_COPTS,
  810. linkopts = ABSL_DEFAULT_LINKOPTS,
  811. deps = [
  812. ":hash_generator_testing",
  813. ":hash_policy_testing",
  814. "@com_google_googletest//:gtest",
  815. ],
  816. )
  817. cc_library(
  818. name = "unordered_map_modifiers_test",
  819. testonly = True,
  820. hdrs = ["internal/unordered_map_modifiers_test.h"],
  821. copts = ABSL_TEST_COPTS,
  822. linkopts = ABSL_DEFAULT_LINKOPTS,
  823. deps = [
  824. ":hash_generator_testing",
  825. ":hash_policy_testing",
  826. "@com_google_googletest//:gtest",
  827. ],
  828. )
  829. cc_library(
  830. name = "unordered_set_constructor_test",
  831. testonly = True,
  832. hdrs = ["internal/unordered_set_constructor_test.h"],
  833. copts = ABSL_TEST_COPTS,
  834. linkopts = ABSL_DEFAULT_LINKOPTS,
  835. deps = [
  836. ":hash_generator_testing",
  837. ":hash_policy_testing",
  838. "//absl/meta:type_traits",
  839. "@com_google_googletest//:gtest",
  840. ],
  841. )
  842. cc_library(
  843. name = "unordered_set_members_test",
  844. testonly = True,
  845. hdrs = ["internal/unordered_set_members_test.h"],
  846. copts = ABSL_TEST_COPTS,
  847. linkopts = ABSL_DEFAULT_LINKOPTS,
  848. deps = [
  849. "//absl/meta:type_traits",
  850. "@com_google_googletest//:gtest",
  851. ],
  852. )
  853. cc_library(
  854. name = "unordered_map_members_test",
  855. testonly = True,
  856. hdrs = ["internal/unordered_map_members_test.h"],
  857. copts = ABSL_TEST_COPTS,
  858. linkopts = ABSL_DEFAULT_LINKOPTS,
  859. deps = [
  860. "//absl/meta:type_traits",
  861. "@com_google_googletest//:gtest",
  862. ],
  863. )
  864. cc_library(
  865. name = "unordered_set_lookup_test",
  866. testonly = True,
  867. hdrs = ["internal/unordered_set_lookup_test.h"],
  868. copts = ABSL_TEST_COPTS,
  869. linkopts = ABSL_DEFAULT_LINKOPTS,
  870. deps = [
  871. ":hash_generator_testing",
  872. ":hash_policy_testing",
  873. "@com_google_googletest//:gtest",
  874. ],
  875. )
  876. cc_library(
  877. name = "unordered_set_modifiers_test",
  878. testonly = True,
  879. hdrs = ["internal/unordered_set_modifiers_test.h"],
  880. copts = ABSL_TEST_COPTS,
  881. linkopts = ABSL_DEFAULT_LINKOPTS,
  882. deps = [
  883. ":hash_generator_testing",
  884. ":hash_policy_testing",
  885. "@com_google_googletest//:gtest",
  886. ],
  887. )
  888. cc_test(
  889. name = "unordered_set_test",
  890. srcs = ["internal/unordered_set_test.cc"],
  891. copts = ABSL_TEST_COPTS,
  892. linkopts = ABSL_DEFAULT_LINKOPTS,
  893. tags = ["no_test_loonix"],
  894. deps = [
  895. ":unordered_set_constructor_test",
  896. ":unordered_set_lookup_test",
  897. ":unordered_set_members_test",
  898. ":unordered_set_modifiers_test",
  899. "@com_google_googletest//:gtest",
  900. "@com_google_googletest//:gtest_main",
  901. ],
  902. )
  903. cc_test(
  904. name = "unordered_map_test",
  905. srcs = ["internal/unordered_map_test.cc"],
  906. copts = ABSL_TEST_COPTS,
  907. linkopts = ABSL_DEFAULT_LINKOPTS,
  908. tags = ["no_test_loonix"],
  909. deps = [
  910. ":unordered_map_constructor_test",
  911. ":unordered_map_lookup_test",
  912. ":unordered_map_members_test",
  913. ":unordered_map_modifiers_test",
  914. "@com_google_googletest//:gtest",
  915. "@com_google_googletest//:gtest_main",
  916. ],
  917. )
  918. cc_test(
  919. name = "sample_element_size_test",
  920. srcs = ["sample_element_size_test.cc"],
  921. copts = ABSL_TEST_COPTS,
  922. linkopts = ABSL_DEFAULT_LINKOPTS,
  923. tags = ["no_test_loonix"],
  924. visibility = ["//visibility:private"],
  925. deps = [
  926. ":flat_hash_map",
  927. ":flat_hash_set",
  928. ":node_hash_map",
  929. ":node_hash_set",
  930. "@com_google_googletest//:gtest",
  931. "@com_google_googletest//:gtest_main",
  932. ],
  933. )
  934. cc_library(
  935. name = "btree",
  936. srcs = [
  937. "internal/btree.h",
  938. "internal/btree_container.h",
  939. ],
  940. hdrs = [
  941. "btree_map.h",
  942. "btree_set.h",
  943. ],
  944. copts = ABSL_DEFAULT_COPTS,
  945. linkopts = ABSL_DEFAULT_LINKOPTS,
  946. visibility = ["//visibility:public"],
  947. deps = [
  948. ":common",
  949. ":common_policy_traits",
  950. ":compressed_tuple",
  951. ":container_memory",
  952. ":layout",
  953. "//absl/base:config",
  954. "//absl/base:core_headers",
  955. "//absl/base:raw_logging_internal",
  956. "//absl/base:throw_delegate",
  957. "//absl/memory",
  958. "//absl/meta:type_traits",
  959. "//absl/strings",
  960. "//absl/strings:cord",
  961. "//absl/types:compare",
  962. ],
  963. )
  964. cc_library(
  965. name = "btree_test_common",
  966. testonly = True,
  967. hdrs = ["btree_test.h"],
  968. copts = ABSL_TEST_COPTS,
  969. linkopts = ABSL_DEFAULT_LINKOPTS,
  970. visibility = ["//visibility:private"],
  971. deps = [
  972. ":btree",
  973. ":flat_hash_set",
  974. "//absl/strings",
  975. "//absl/strings:cord",
  976. "//absl/time",
  977. ],
  978. )
  979. cc_test(
  980. name = "btree_test",
  981. size = "large",
  982. srcs = [
  983. "btree_test.cc",
  984. ],
  985. copts = ABSL_TEST_COPTS,
  986. linkopts = ABSL_DEFAULT_LINKOPTS,
  987. shard_count = 10,
  988. tags = [
  989. "no_test:os:ios",
  990. "no_test_ios",
  991. "no_test_wasm",
  992. ],
  993. visibility = ["//visibility:private"],
  994. deps = [
  995. ":btree",
  996. ":btree_test_common",
  997. ":test_allocator",
  998. ":test_instance_tracker",
  999. "//absl/algorithm:container",
  1000. "//absl/base:core_headers",
  1001. "//absl/base:raw_logging_internal",
  1002. "//absl/flags:flag",
  1003. "//absl/hash:hash_testing",
  1004. "//absl/memory",
  1005. "//absl/random",
  1006. "//absl/strings",
  1007. "//absl/types:compare",
  1008. "//absl/types:optional",
  1009. "@com_google_googletest//:gtest",
  1010. "@com_google_googletest//:gtest_main",
  1011. ],
  1012. )
  1013. cc_binary(
  1014. name = "btree_benchmark",
  1015. testonly = True,
  1016. srcs = [
  1017. "btree_benchmark.cc",
  1018. ],
  1019. copts = ABSL_TEST_COPTS,
  1020. linkopts = ABSL_DEFAULT_LINKOPTS,
  1021. tags = ["benchmark"],
  1022. visibility = ["//visibility:private"],
  1023. deps = [
  1024. ":btree",
  1025. ":btree_test_common",
  1026. ":flat_hash_map",
  1027. ":flat_hash_set",
  1028. ":hashtable_debug",
  1029. "//absl/algorithm:container",
  1030. "//absl/base:raw_logging_internal",
  1031. "//absl/hash",
  1032. "//absl/log",
  1033. "//absl/memory",
  1034. "//absl/random",
  1035. "//absl/strings:cord",
  1036. "//absl/strings:str_format",
  1037. "//absl/time",
  1038. "@com_github_google_benchmark//:benchmark_main",
  1039. "@com_google_googletest//:gtest",
  1040. ],
  1041. )