BUILD.bazel 24 KB

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