1# This file @generated by `python buckifier/buckify_rocksdb.py`
2# --> DO NOT EDIT MANUALLY <--
3# This file is a Facebook-specific integration for buck builds, so can
4# only be validated by Facebook employees.
5#
6load("@fbcode_macros//build_defs:auto_headers.bzl", "AutoHeaders")
7load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
8load(":defs.bzl", "test_binary")
9
10REPO_PATH = package_name() + "/"
11
12ROCKSDB_COMPILER_FLAGS = [
13    "-fno-builtin-memcmp",
14    # Needed to compile in fbcode
15    "-Wno-expansion-to-defined",
16    # Added missing flags from output of build_detect_platform
17    "-Wnarrowing",
18    "-DROCKSDB_NO_DYNAMIC_EXTENSION",
19]
20
21ROCKSDB_EXTERNAL_DEPS = [
22    ("bzip2", None, "bz2"),
23    ("snappy", None, "snappy"),
24    ("zlib", None, "z"),
25    ("gflags", None, "gflags"),
26    ("lz4", None, "lz4"),
27    ("zstd", None),
28    ("tbb", None),
29    ("googletest", None, "gtest"),
30]
31
32ROCKSDB_OS_DEPS = [
33    (
34        "linux",
35        ["third-party//numa:numa", "third-party//liburing:uring"],
36    ),
37]
38
39ROCKSDB_OS_PREPROCESSOR_FLAGS = [
40    (
41        "linux",
42        [
43            "-DOS_LINUX",
44            "-DROCKSDB_FALLOCATE_PRESENT",
45            "-DROCKSDB_MALLOC_USABLE_SIZE",
46            "-DROCKSDB_PTHREAD_ADAPTIVE_MUTEX",
47            "-DROCKSDB_RANGESYNC_PRESENT",
48            "-DROCKSDB_SCHED_GETCPU_PRESENT",
49            "-DROCKSDB_IOURING_PRESENT",
50            "-DHAVE_SSE42",
51            "-DLIBURING",
52            "-DNUMA",
53        ],
54    ),
55    (
56        "macos",
57        ["-DOS_MACOSX"],
58    ),
59]
60
61ROCKSDB_PREPROCESSOR_FLAGS = [
62    "-DROCKSDB_PLATFORM_POSIX",
63    "-DROCKSDB_LIB_IO_POSIX",
64    "-DROCKSDB_SUPPORT_THREAD_LOCAL",
65
66    # Flags to enable libs we include
67    "-DSNAPPY",
68    "-DZLIB",
69    "-DBZIP2",
70    "-DLZ4",
71    "-DZSTD",
72    "-DZSTD_STATIC_LINKING_ONLY",
73    "-DGFLAGS=gflags",
74    "-DTBB",
75
76    # Added missing flags from output of build_detect_platform
77    "-DROCKSDB_BACKTRACE",
78
79    # Directories with files for #include
80    "-I" + REPO_PATH + "include/",
81    "-I" + REPO_PATH,
82]
83
84ROCKSDB_ARCH_PREPROCESSOR_FLAGS = {
85    "x86_64": [
86        "-DHAVE_PCLMUL",
87    ],
88}
89
90build_mode = read_config("fbcode", "build_mode")
91
92is_opt_mode = build_mode.startswith("opt")
93
94# -DNDEBUG is added by default in opt mode in fbcode. But adding it twice
95# doesn't harm and avoid forgetting to add it.
96ROCKSDB_COMPILER_FLAGS += (["-DNDEBUG"] if is_opt_mode else [])
97
98sanitizer = read_config("fbcode", "sanitizer")
99
100# Do not enable jemalloc if sanitizer presents. RocksDB will further detect
101# whether the binary is linked with jemalloc at runtime.
102ROCKSDB_OS_PREPROCESSOR_FLAGS += ([(
103    "linux",
104    ["-DROCKSDB_JEMALLOC"],
105)] if sanitizer == "" else [])
106
107ROCKSDB_OS_DEPS += ([(
108    "linux",
109    ["third-party//jemalloc:headers"],
110)] if sanitizer == "" else [])
111
112cpp_library(
113    name = "rocksdb_lib",
114    srcs = [
115        "cache/clock_cache.cc",
116        "cache/lru_cache.cc",
117        "cache/sharded_cache.cc",
118        "db/arena_wrapped_db_iter.cc",
119        "db/blob/blob_file_addition.cc",
120        "db/blob/blob_file_garbage.cc",
121        "db/blob/blob_file_meta.cc",
122        "db/builder.cc",
123        "db/c.cc",
124        "db/column_family.cc",
125        "db/compacted_db_impl.cc",
126        "db/compaction/compaction.cc",
127        "db/compaction/compaction_iterator.cc",
128        "db/compaction/compaction_job.cc",
129        "db/compaction/compaction_picker.cc",
130        "db/compaction/compaction_picker_fifo.cc",
131        "db/compaction/compaction_picker_level.cc",
132        "db/compaction/compaction_picker_universal.cc",
133        "db/convenience.cc",
134        "db/db_filesnapshot.cc",
135        "db/db_impl/db_impl.cc",
136        "db/db_impl/db_impl_compaction_flush.cc",
137        "db/db_impl/db_impl_debug.cc",
138        "db/db_impl/db_impl_experimental.cc",
139        "db/db_impl/db_impl_files.cc",
140        "db/db_impl/db_impl_open.cc",
141        "db/db_impl/db_impl_readonly.cc",
142        "db/db_impl/db_impl_secondary.cc",
143        "db/db_impl/db_impl_write.cc",
144        "db/db_info_dumper.cc",
145        "db/db_iter.cc",
146        "db/dbformat.cc",
147        "db/error_handler.cc",
148        "db/event_helpers.cc",
149        "db/experimental.cc",
150        "db/external_sst_file_ingestion_job.cc",
151        "db/file_indexer.cc",
152        "db/flush_job.cc",
153        "db/flush_scheduler.cc",
154        "db/forward_iterator.cc",
155        "db/import_column_family_job.cc",
156        "db/internal_stats.cc",
157        "db/log_reader.cc",
158        "db/log_writer.cc",
159        "db/logs_with_prep_tracker.cc",
160        "db/malloc_stats.cc",
161        "db/memtable.cc",
162        "db/memtable_list.cc",
163        "db/merge_helper.cc",
164        "db/merge_operator.cc",
165        "db/range_del_aggregator.cc",
166        "db/range_tombstone_fragmenter.cc",
167        "db/repair.cc",
168        "db/snapshot_impl.cc",
169        "db/table_cache.cc",
170        "db/table_properties_collector.cc",
171        "db/transaction_log_impl.cc",
172        "db/trim_history_scheduler.cc",
173        "db/version_builder.cc",
174        "db/version_edit.cc",
175        "db/version_edit_handler.cc",
176        "db/version_set.cc",
177        "db/wal_manager.cc",
178        "db/write_batch.cc",
179        "db/write_batch_base.cc",
180        "db/write_controller.cc",
181        "db/write_thread.cc",
182        "env/env.cc",
183        "env/env_chroot.cc",
184        "env/env_encryption.cc",
185        "env/env_hdfs.cc",
186        "env/env_posix.cc",
187        "env/file_system.cc",
188        "env/fs_posix.cc",
189        "env/io_posix.cc",
190        "env/mock_env.cc",
191        "file/delete_scheduler.cc",
192        "file/file_prefetch_buffer.cc",
193        "file/file_util.cc",
194        "file/filename.cc",
195        "file/random_access_file_reader.cc",
196        "file/read_write_util.cc",
197        "file/readahead_raf.cc",
198        "file/sequence_file_reader.cc",
199        "file/sst_file_manager_impl.cc",
200        "file/writable_file_writer.cc",
201        "logging/auto_roll_logger.cc",
202        "logging/event_logger.cc",
203        "logging/log_buffer.cc",
204        "memory/arena.cc",
205        "memory/concurrent_arena.cc",
206        "memory/jemalloc_nodump_allocator.cc",
207        "memtable/alloc_tracker.cc",
208        "memtable/hash_linklist_rep.cc",
209        "memtable/hash_skiplist_rep.cc",
210        "memtable/skiplistrep.cc",
211        "memtable/vectorrep.cc",
212        "memtable/write_buffer_manager.cc",
213        "monitoring/histogram.cc",
214        "monitoring/histogram_windowing.cc",
215        "monitoring/in_memory_stats_history.cc",
216        "monitoring/instrumented_mutex.cc",
217        "monitoring/iostats_context.cc",
218        "monitoring/perf_context.cc",
219        "monitoring/perf_level.cc",
220        "monitoring/persistent_stats_history.cc",
221        "monitoring/statistics.cc",
222        "monitoring/thread_status_impl.cc",
223        "monitoring/thread_status_updater.cc",
224        "monitoring/thread_status_updater_debug.cc",
225        "monitoring/thread_status_util.cc",
226        "monitoring/thread_status_util_debug.cc",
227        "options/cf_options.cc",
228        "options/db_options.cc",
229        "options/options.cc",
230        "options/options_helper.cc",
231        "options/options_parser.cc",
232        "options/options_sanity_check.cc",
233        "port/port_posix.cc",
234        "port/stack_trace.cc",
235        "table/adaptive/adaptive_table_factory.cc",
236        "table/block_based/binary_search_index_reader.cc",
237        "table/block_based/block.cc",
238        "table/block_based/block_based_filter_block.cc",
239        "table/block_based/block_based_table_builder.cc",
240        "table/block_based/block_based_table_factory.cc",
241        "table/block_based/block_based_table_iterator.cc",
242        "table/block_based/block_based_table_reader.cc",
243        "table/block_based/block_builder.cc",
244        "table/block_based/block_prefetcher.cc",
245        "table/block_based/block_prefix_index.cc",
246        "table/block_based/data_block_footer.cc",
247        "table/block_based/data_block_hash_index.cc",
248        "table/block_based/filter_block_reader_common.cc",
249        "table/block_based/filter_policy.cc",
250        "table/block_based/flush_block_policy.cc",
251        "table/block_based/full_filter_block.cc",
252        "table/block_based/hash_index_reader.cc",
253        "table/block_based/index_builder.cc",
254        "table/block_based/index_reader_common.cc",
255        "table/block_based/parsed_full_filter_block.cc",
256        "table/block_based/partitioned_filter_block.cc",
257        "table/block_based/partitioned_index_iterator.cc",
258        "table/block_based/partitioned_index_reader.cc",
259        "table/block_based/reader_common.cc",
260        "table/block_based/uncompression_dict_reader.cc",
261        "table/block_fetcher.cc",
262        "table/cuckoo/cuckoo_table_builder.cc",
263        "table/cuckoo/cuckoo_table_factory.cc",
264        "table/cuckoo/cuckoo_table_reader.cc",
265        "table/format.cc",
266        "table/get_context.cc",
267        "table/iterator.cc",
268        "table/merging_iterator.cc",
269        "table/meta_blocks.cc",
270        "table/persistent_cache_helper.cc",
271        "table/plain/plain_table_bloom.cc",
272        "table/plain/plain_table_builder.cc",
273        "table/plain/plain_table_factory.cc",
274        "table/plain/plain_table_index.cc",
275        "table/plain/plain_table_key_coding.cc",
276        "table/plain/plain_table_reader.cc",
277        "table/sst_file_reader.cc",
278        "table/sst_file_writer.cc",
279        "table/table_properties.cc",
280        "table/two_level_iterator.cc",
281        "test_util/sync_point.cc",
282        "test_util/sync_point_impl.cc",
283        "test_util/transaction_test_util.cc",
284        "tools/dump/db_dump_tool.cc",
285        "tools/ldb_cmd.cc",
286        "tools/ldb_tool.cc",
287        "tools/sst_dump_tool.cc",
288        "trace_replay/block_cache_tracer.cc",
289        "trace_replay/trace_replay.cc",
290        "util/build_version.cc",
291        "util/coding.cc",
292        "util/compaction_job_stats_impl.cc",
293        "util/comparator.cc",
294        "util/compression_context_cache.cc",
295        "util/concurrent_task_limiter_impl.cc",
296        "util/crc32c.cc",
297        "util/dynamic_bloom.cc",
298        "util/file_checksum_helper.cc",
299        "util/hash.cc",
300        "util/murmurhash.cc",
301        "util/random.cc",
302        "util/rate_limiter.cc",
303        "util/slice.cc",
304        "util/status.cc",
305        "util/string_util.cc",
306        "util/thread_local.cc",
307        "util/threadpool_imp.cc",
308        "util/xxhash.cc",
309        "utilities/backupable/backupable_db.cc",
310        "utilities/blob_db/blob_compaction_filter.cc",
311        "utilities/blob_db/blob_db.cc",
312        "utilities/blob_db/blob_db_impl.cc",
313        "utilities/blob_db/blob_db_impl_filesnapshot.cc",
314        "utilities/blob_db/blob_dump_tool.cc",
315        "utilities/blob_db/blob_file.cc",
316        "utilities/blob_db/blob_log_format.cc",
317        "utilities/blob_db/blob_log_reader.cc",
318        "utilities/blob_db/blob_log_writer.cc",
319        "utilities/cassandra/cassandra_compaction_filter.cc",
320        "utilities/cassandra/format.cc",
321        "utilities/cassandra/merge_operator.cc",
322        "utilities/checkpoint/checkpoint_impl.cc",
323        "utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc",
324        "utilities/convenience/info_log_finder.cc",
325        "utilities/debug.cc",
326        "utilities/env_mirror.cc",
327        "utilities/env_timed.cc",
328        "utilities/leveldb_options/leveldb_options.cc",
329        "utilities/memory/memory_util.cc",
330        "utilities/merge_operators/bytesxor.cc",
331        "utilities/merge_operators/max.cc",
332        "utilities/merge_operators/put.cc",
333        "utilities/merge_operators/sortlist.cc",
334        "utilities/merge_operators/string_append/stringappend.cc",
335        "utilities/merge_operators/string_append/stringappend2.cc",
336        "utilities/merge_operators/uint64add.cc",
337        "utilities/object_registry.cc",
338        "utilities/option_change_migration/option_change_migration.cc",
339        "utilities/options/options_util.cc",
340        "utilities/persistent_cache/block_cache_tier.cc",
341        "utilities/persistent_cache/block_cache_tier_file.cc",
342        "utilities/persistent_cache/block_cache_tier_metadata.cc",
343        "utilities/persistent_cache/persistent_cache_tier.cc",
344        "utilities/persistent_cache/volatile_tier_impl.cc",
345        "utilities/simulator_cache/cache_simulator.cc",
346        "utilities/simulator_cache/sim_cache.cc",
347        "utilities/table_properties_collectors/compact_on_deletion_collector.cc",
348        "utilities/trace/file_trace_reader_writer.cc",
349        "utilities/transactions/optimistic_transaction.cc",
350        "utilities/transactions/optimistic_transaction_db_impl.cc",
351        "utilities/transactions/pessimistic_transaction.cc",
352        "utilities/transactions/pessimistic_transaction_db.cc",
353        "utilities/transactions/snapshot_checker.cc",
354        "utilities/transactions/transaction_base.cc",
355        "utilities/transactions/transaction_db_mutex_impl.cc",
356        "utilities/transactions/transaction_lock_mgr.cc",
357        "utilities/transactions/transaction_util.cc",
358        "utilities/transactions/write_prepared_txn.cc",
359        "utilities/transactions/write_prepared_txn_db.cc",
360        "utilities/transactions/write_unprepared_txn.cc",
361        "utilities/transactions/write_unprepared_txn_db.cc",
362        "utilities/ttl/db_ttl_impl.cc",
363        "utilities/write_batch_with_index/write_batch_with_index.cc",
364        "utilities/write_batch_with_index/write_batch_with_index_internal.cc",
365    ],
366    auto_headers = AutoHeaders.RECURSIVE_GLOB,
367    arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
368    compiler_flags = ROCKSDB_COMPILER_FLAGS,
369    os_deps = ROCKSDB_OS_DEPS,
370    os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS,
371    preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
372    deps = [],
373    external_deps = ROCKSDB_EXTERNAL_DEPS,
374)
375
376cpp_library(
377    name = "rocksdb_test_lib",
378    srcs = [
379        "db/db_test_util.cc",
380        "table/mock_table.cc",
381        "test_util/fault_injection_test_env.cc",
382        "test_util/fault_injection_test_fs.cc",
383        "test_util/testharness.cc",
384        "test_util/testutil.cc",
385        "tools/block_cache_analyzer/block_cache_trace_analyzer.cc",
386        "tools/trace_analyzer_tool.cc",
387        "utilities/cassandra/test_utils.cc",
388    ],
389    auto_headers = AutoHeaders.RECURSIVE_GLOB,
390    arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
391    compiler_flags = ROCKSDB_COMPILER_FLAGS,
392    os_deps = ROCKSDB_OS_DEPS,
393    os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS,
394    preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
395    deps = [":rocksdb_lib"],
396    external_deps = ROCKSDB_EXTERNAL_DEPS,
397)
398
399cpp_library(
400    name = "rocksdb_tools_lib",
401    srcs = [
402        "test_util/testutil.cc",
403        "tools/block_cache_analyzer/block_cache_trace_analyzer.cc",
404        "tools/db_bench_tool.cc",
405        "tools/trace_analyzer_tool.cc",
406    ],
407    auto_headers = AutoHeaders.RECURSIVE_GLOB,
408    arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
409    compiler_flags = ROCKSDB_COMPILER_FLAGS,
410    os_deps = ROCKSDB_OS_DEPS,
411    os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS,
412    preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
413    deps = [":rocksdb_lib"],
414    external_deps = ROCKSDB_EXTERNAL_DEPS,
415)
416
417cpp_library(
418    name = "rocksdb_stress_lib",
419    srcs = [
420        "db_stress_tool/batched_ops_stress.cc",
421        "db_stress_tool/cf_consistency_stress.cc",
422        "db_stress_tool/db_stress_common.cc",
423        "db_stress_tool/db_stress_driver.cc",
424        "db_stress_tool/db_stress_gflags.cc",
425        "db_stress_tool/db_stress_shared_state.cc",
426        "db_stress_tool/db_stress_test_base.cc",
427        "db_stress_tool/db_stress_tool.cc",
428        "db_stress_tool/no_batched_ops_stress.cc",
429        "test_util/testutil.cc",
430        "tools/block_cache_analyzer/block_cache_trace_analyzer.cc",
431        "tools/trace_analyzer_tool.cc",
432    ],
433    auto_headers = AutoHeaders.RECURSIVE_GLOB,
434    arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
435    compiler_flags = ROCKSDB_COMPILER_FLAGS,
436    os_deps = ROCKSDB_OS_DEPS,
437    os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS,
438    preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
439    deps = [":rocksdb_lib"],
440    external_deps = ROCKSDB_EXTERNAL_DEPS,
441)
442
443cpp_library(
444    name = "env_basic_test_lib",
445    srcs = ["env/env_basic_test.cc"],
446    auto_headers = AutoHeaders.RECURSIVE_GLOB,
447    arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
448    compiler_flags = ROCKSDB_COMPILER_FLAGS,
449    os_deps = ROCKSDB_OS_DEPS,
450    os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS,
451    preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
452    deps = [":rocksdb_test_lib"],
453    external_deps = ROCKSDB_EXTERNAL_DEPS,
454)
455
456# [test_name, test_src, test_type, extra_deps, extra_compiler_flags]
457ROCKS_TESTS = [
458    [
459        "arena_test",
460        "memory/arena_test.cc",
461        "serial",
462        [],
463        [],
464    ],
465    [
466        "auto_roll_logger_test",
467        "logging/auto_roll_logger_test.cc",
468        "serial",
469        [],
470        [],
471    ],
472    [
473        "autovector_test",
474        "util/autovector_test.cc",
475        "serial",
476        [],
477        [],
478    ],
479    [
480        "backupable_db_test",
481        "utilities/backupable/backupable_db_test.cc",
482        "parallel",
483        [],
484        [],
485    ],
486    [
487        "blob_db_test",
488        "utilities/blob_db/blob_db_test.cc",
489        "serial",
490        [],
491        [],
492    ],
493    [
494        "blob_file_addition_test",
495        "db/blob/blob_file_addition_test.cc",
496        "serial",
497        [],
498        [],
499    ],
500    [
501        "blob_file_garbage_test",
502        "db/blob/blob_file_garbage_test.cc",
503        "serial",
504        [],
505        [],
506    ],
507    [
508        "block_based_filter_block_test",
509        "table/block_based/block_based_filter_block_test.cc",
510        "serial",
511        [],
512        [],
513    ],
514    [
515        "block_cache_trace_analyzer_test",
516        "tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc",
517        "serial",
518        [],
519        [],
520    ],
521    [
522        "block_cache_tracer_test",
523        "trace_replay/block_cache_tracer_test.cc",
524        "serial",
525        [],
526        [],
527    ],
528    [
529        "block_test",
530        "table/block_based/block_test.cc",
531        "serial",
532        [],
533        [],
534    ],
535    [
536        "bloom_test",
537        "util/bloom_test.cc",
538        "serial",
539        [],
540        [],
541    ],
542    [
543        "c_test",
544        "db/c_test.c",
545        "serial",
546        [],
547        [],
548    ],
549    [
550        "cache_simulator_test",
551        "utilities/simulator_cache/cache_simulator_test.cc",
552        "serial",
553        [],
554        [],
555    ],
556    [
557        "cache_test",
558        "cache/cache_test.cc",
559        "serial",
560        [],
561        [],
562    ],
563    [
564        "cassandra_format_test",
565        "utilities/cassandra/cassandra_format_test.cc",
566        "serial",
567        [],
568        [],
569    ],
570    [
571        "cassandra_functional_test",
572        "utilities/cassandra/cassandra_functional_test.cc",
573        "serial",
574        [],
575        [],
576    ],
577    [
578        "cassandra_row_merge_test",
579        "utilities/cassandra/cassandra_row_merge_test.cc",
580        "serial",
581        [],
582        [],
583    ],
584    [
585        "cassandra_serialize_test",
586        "utilities/cassandra/cassandra_serialize_test.cc",
587        "serial",
588        [],
589        [],
590    ],
591    [
592        "checkpoint_test",
593        "utilities/checkpoint/checkpoint_test.cc",
594        "serial",
595        [],
596        [],
597    ],
598    [
599        "cleanable_test",
600        "table/cleanable_test.cc",
601        "serial",
602        [],
603        [],
604    ],
605    [
606        "coding_test",
607        "util/coding_test.cc",
608        "serial",
609        [],
610        [],
611    ],
612    [
613        "column_family_test",
614        "db/column_family_test.cc",
615        "serial",
616        [],
617        [],
618    ],
619    [
620        "compact_files_test",
621        "db/compact_files_test.cc",
622        "serial",
623        [],
624        [],
625    ],
626    [
627        "compact_on_deletion_collector_test",
628        "utilities/table_properties_collectors/compact_on_deletion_collector_test.cc",
629        "serial",
630        [],
631        [],
632    ],
633    [
634        "compaction_iterator_test",
635        "db/compaction/compaction_iterator_test.cc",
636        "serial",
637        [],
638        [],
639    ],
640    [
641        "compaction_job_stats_test",
642        "db/compaction/compaction_job_stats_test.cc",
643        "serial",
644        [],
645        [],
646    ],
647    [
648        "compaction_job_test",
649        "db/compaction/compaction_job_test.cc",
650        "serial",
651        [],
652        [],
653    ],
654    [
655        "compaction_picker_test",
656        "db/compaction/compaction_picker_test.cc",
657        "serial",
658        [],
659        [],
660    ],
661    [
662        "comparator_db_test",
663        "db/comparator_db_test.cc",
664        "serial",
665        [],
666        [],
667    ],
668    [
669        "corruption_test",
670        "db/corruption_test.cc",
671        "serial",
672        [],
673        [],
674    ],
675    [
676        "crc32c_test",
677        "util/crc32c_test.cc",
678        "serial",
679        [],
680        [],
681    ],
682    [
683        "cuckoo_table_builder_test",
684        "table/cuckoo/cuckoo_table_builder_test.cc",
685        "serial",
686        [],
687        [],
688    ],
689    [
690        "cuckoo_table_db_test",
691        "db/cuckoo_table_db_test.cc",
692        "serial",
693        [],
694        [],
695    ],
696    [
697        "cuckoo_table_reader_test",
698        "table/cuckoo/cuckoo_table_reader_test.cc",
699        "serial",
700        [],
701        [],
702    ],
703    [
704        "data_block_hash_index_test",
705        "table/block_based/data_block_hash_index_test.cc",
706        "serial",
707        [],
708        [],
709    ],
710    [
711        "db_basic_test",
712        "db/db_basic_test.cc",
713        "serial",
714        [],
715        [],
716    ],
717    [
718        "db_blob_index_test",
719        "db/blob/db_blob_index_test.cc",
720        "serial",
721        [],
722        [],
723    ],
724    [
725        "db_block_cache_test",
726        "db/db_block_cache_test.cc",
727        "serial",
728        [],
729        [],
730    ],
731    [
732        "db_bloom_filter_test",
733        "db/db_bloom_filter_test.cc",
734        "parallel",
735        [],
736        [],
737    ],
738    [
739        "db_compaction_filter_test",
740        "db/db_compaction_filter_test.cc",
741        "parallel",
742        [],
743        [],
744    ],
745    [
746        "db_compaction_test",
747        "db/db_compaction_test.cc",
748        "parallel",
749        [],
750        [],
751    ],
752    [
753        "db_dynamic_level_test",
754        "db/db_dynamic_level_test.cc",
755        "serial",
756        [],
757        [],
758    ],
759    [
760        "db_encryption_test",
761        "db/db_encryption_test.cc",
762        "serial",
763        [],
764        [],
765    ],
766    [
767        "db_flush_test",
768        "db/db_flush_test.cc",
769        "serial",
770        [],
771        [],
772    ],
773    [
774        "db_inplace_update_test",
775        "db/db_inplace_update_test.cc",
776        "serial",
777        [],
778        [],
779    ],
780    [
781        "db_io_failure_test",
782        "db/db_io_failure_test.cc",
783        "serial",
784        [],
785        [],
786    ],
787    [
788        "db_iter_stress_test",
789        "db/db_iter_stress_test.cc",
790        "serial",
791        [],
792        [],
793    ],
794    [
795        "db_iter_test",
796        "db/db_iter_test.cc",
797        "serial",
798        [],
799        [],
800    ],
801    [
802        "db_iterator_test",
803        "db/db_iterator_test.cc",
804        "serial",
805        [],
806        [],
807    ],
808    [
809        "db_log_iter_test",
810        "db/db_log_iter_test.cc",
811        "serial",
812        [],
813        [],
814    ],
815    [
816        "db_logical_block_size_cache_test",
817        "db/db_logical_block_size_cache_test.cc",
818        "serial",
819        [],
820        [],
821    ],
822    [
823        "db_memtable_test",
824        "db/db_memtable_test.cc",
825        "serial",
826        [],
827        [],
828    ],
829    [
830        "db_merge_operand_test",
831        "db/db_merge_operand_test.cc",
832        "serial",
833        [],
834        [],
835    ],
836    [
837        "db_merge_operator_test",
838        "db/db_merge_operator_test.cc",
839        "parallel",
840        [],
841        [],
842    ],
843    [
844        "db_options_test",
845        "db/db_options_test.cc",
846        "serial",
847        [],
848        [],
849    ],
850    [
851        "db_properties_test",
852        "db/db_properties_test.cc",
853        "serial",
854        [],
855        [],
856    ],
857    [
858        "db_range_del_test",
859        "db/db_range_del_test.cc",
860        "serial",
861        [],
862        [],
863    ],
864    [
865        "db_secondary_test",
866        "db/db_impl/db_secondary_test.cc",
867        "serial",
868        [],
869        [],
870    ],
871    [
872        "db_sst_test",
873        "db/db_sst_test.cc",
874        "parallel",
875        [],
876        [],
877    ],
878    [
879        "db_statistics_test",
880        "db/db_statistics_test.cc",
881        "serial",
882        [],
883        [],
884    ],
885    [
886        "db_table_properties_test",
887        "db/db_table_properties_test.cc",
888        "serial",
889        [],
890        [],
891    ],
892    [
893        "db_tailing_iter_test",
894        "db/db_tailing_iter_test.cc",
895        "serial",
896        [],
897        [],
898    ],
899    [
900        "db_test",
901        "db/db_test.cc",
902        "parallel",
903        [],
904        [],
905    ],
906    [
907        "db_test2",
908        "db/db_test2.cc",
909        "serial",
910        [],
911        [],
912    ],
913    [
914        "db_universal_compaction_test",
915        "db/db_universal_compaction_test.cc",
916        "parallel",
917        [],
918        [],
919    ],
920    [
921        "db_wal_test",
922        "db/db_wal_test.cc",
923        "parallel",
924        [],
925        [],
926    ],
927    [
928        "db_with_timestamp_basic_test",
929        "db/db_with_timestamp_basic_test.cc",
930        "serial",
931        [],
932        [],
933    ],
934    [
935        "db_write_test",
936        "db/db_write_test.cc",
937        "serial",
938        [],
939        [],
940    ],
941    [
942        "dbformat_test",
943        "db/dbformat_test.cc",
944        "serial",
945        [],
946        [],
947    ],
948    [
949        "defer_test",
950        "util/defer_test.cc",
951        "serial",
952        [],
953        [],
954    ],
955    [
956        "delete_scheduler_test",
957        "file/delete_scheduler_test.cc",
958        "serial",
959        [],
960        [],
961    ],
962    [
963        "deletefile_test",
964        "db/deletefile_test.cc",
965        "serial",
966        [],
967        [],
968    ],
969    [
970        "dynamic_bloom_test",
971        "util/dynamic_bloom_test.cc",
972        "serial",
973        [],
974        [],
975    ],
976    [
977        "env_basic_test",
978        "env/env_basic_test.cc",
979        "serial",
980        [],
981        [],
982    ],
983    [
984        "env_logger_test",
985        "logging/env_logger_test.cc",
986        "serial",
987        [],
988        [],
989    ],
990    [
991        "env_test",
992        "env/env_test.cc",
993        "serial",
994        [],
995        [],
996    ],
997    [
998        "env_timed_test",
999        "utilities/env_timed_test.cc",
1000        "serial",
1001        [],
1002        [],
1003    ],
1004    [
1005        "error_handler_fs_test",
1006        "db/error_handler_fs_test.cc",
1007        "serial",
1008        [],
1009        [],
1010    ],
1011    [
1012        "event_logger_test",
1013        "logging/event_logger_test.cc",
1014        "serial",
1015        [],
1016        [],
1017    ],
1018    [
1019        "external_sst_file_basic_test",
1020        "db/external_sst_file_basic_test.cc",
1021        "serial",
1022        [],
1023        [],
1024    ],
1025    [
1026        "external_sst_file_test",
1027        "db/external_sst_file_test.cc",
1028        "parallel",
1029        [],
1030        [],
1031    ],
1032    [
1033        "fault_injection_test",
1034        "db/fault_injection_test.cc",
1035        "parallel",
1036        [],
1037        [],
1038    ],
1039    [
1040        "file_indexer_test",
1041        "db/file_indexer_test.cc",
1042        "serial",
1043        [],
1044        [],
1045    ],
1046    [
1047        "file_reader_writer_test",
1048        "util/file_reader_writer_test.cc",
1049        "parallel",
1050        [],
1051        [],
1052    ],
1053    [
1054        "filelock_test",
1055        "util/filelock_test.cc",
1056        "serial",
1057        [],
1058        [],
1059    ],
1060    [
1061        "filename_test",
1062        "db/filename_test.cc",
1063        "serial",
1064        [],
1065        [],
1066    ],
1067    [
1068        "flush_job_test",
1069        "db/flush_job_test.cc",
1070        "serial",
1071        [],
1072        [],
1073    ],
1074    [
1075        "full_filter_block_test",
1076        "table/block_based/full_filter_block_test.cc",
1077        "serial",
1078        [],
1079        [],
1080    ],
1081    [
1082        "hash_table_test",
1083        "utilities/persistent_cache/hash_table_test.cc",
1084        "serial",
1085        [],
1086        [],
1087    ],
1088    [
1089        "hash_test",
1090        "util/hash_test.cc",
1091        "serial",
1092        [],
1093        [],
1094    ],
1095    [
1096        "heap_test",
1097        "util/heap_test.cc",
1098        "serial",
1099        [],
1100        [],
1101    ],
1102    [
1103        "histogram_test",
1104        "monitoring/histogram_test.cc",
1105        "serial",
1106        [],
1107        [],
1108    ],
1109    [
1110        "import_column_family_test",
1111        "db/import_column_family_test.cc",
1112        "parallel",
1113        [],
1114        [],
1115    ],
1116    [
1117        "inlineskiplist_test",
1118        "memtable/inlineskiplist_test.cc",
1119        "parallel",
1120        [],
1121        [],
1122    ],
1123    [
1124        "io_posix_test",
1125        "env/io_posix_test.cc",
1126        "serial",
1127        [],
1128        [],
1129    ],
1130    [
1131        "iostats_context_test",
1132        "monitoring/iostats_context_test.cc",
1133        "serial",
1134        [],
1135        [],
1136    ],
1137    [
1138        "ldb_cmd_test",
1139        "tools/ldb_cmd_test.cc",
1140        "serial",
1141        [],
1142        [],
1143    ],
1144    [
1145        "listener_test",
1146        "db/listener_test.cc",
1147        "serial",
1148        [],
1149        [],
1150    ],
1151    [
1152        "log_test",
1153        "db/log_test.cc",
1154        "serial",
1155        [],
1156        [],
1157    ],
1158    [
1159        "lru_cache_test",
1160        "cache/lru_cache_test.cc",
1161        "serial",
1162        [],
1163        [],
1164    ],
1165    [
1166        "manual_compaction_test",
1167        "db/manual_compaction_test.cc",
1168        "parallel",
1169        [],
1170        [],
1171    ],
1172    [
1173        "memory_test",
1174        "utilities/memory/memory_test.cc",
1175        "serial",
1176        [],
1177        [],
1178    ],
1179    [
1180        "memtable_list_test",
1181        "db/memtable_list_test.cc",
1182        "serial",
1183        [],
1184        [],
1185    ],
1186    [
1187        "merge_helper_test",
1188        "db/merge_helper_test.cc",
1189        "serial",
1190        [],
1191        [],
1192    ],
1193    [
1194        "merge_test",
1195        "db/merge_test.cc",
1196        "serial",
1197        [],
1198        [],
1199    ],
1200    [
1201        "merger_test",
1202        "table/merger_test.cc",
1203        "serial",
1204        [],
1205        [],
1206    ],
1207    [
1208        "mock_env_test",
1209        "env/mock_env_test.cc",
1210        "serial",
1211        [],
1212        [],
1213    ],
1214    [
1215        "object_registry_test",
1216        "utilities/object_registry_test.cc",
1217        "serial",
1218        [],
1219        [],
1220    ],
1221    [
1222        "obsolete_files_test",
1223        "db/obsolete_files_test.cc",
1224        "serial",
1225        [],
1226        [],
1227    ],
1228    [
1229        "optimistic_transaction_test",
1230        "utilities/transactions/optimistic_transaction_test.cc",
1231        "serial",
1232        [],
1233        [],
1234    ],
1235    [
1236        "option_change_migration_test",
1237        "utilities/option_change_migration/option_change_migration_test.cc",
1238        "serial",
1239        [],
1240        [],
1241    ],
1242    [
1243        "options_file_test",
1244        "db/options_file_test.cc",
1245        "serial",
1246        [],
1247        [],
1248    ],
1249    [
1250        "options_settable_test",
1251        "options/options_settable_test.cc",
1252        "serial",
1253        [],
1254        [],
1255    ],
1256    [
1257        "options_test",
1258        "options/options_test.cc",
1259        "serial",
1260        [],
1261        [],
1262    ],
1263    [
1264        "options_util_test",
1265        "utilities/options/options_util_test.cc",
1266        "serial",
1267        [],
1268        [],
1269    ],
1270    [
1271        "partitioned_filter_block_test",
1272        "table/block_based/partitioned_filter_block_test.cc",
1273        "serial",
1274        [],
1275        [],
1276    ],
1277    [
1278        "perf_context_test",
1279        "db/perf_context_test.cc",
1280        "serial",
1281        [],
1282        [],
1283    ],
1284    [
1285        "persistent_cache_test",
1286        "utilities/persistent_cache/persistent_cache_test.cc",
1287        "parallel",
1288        [],
1289        [],
1290    ],
1291    [
1292        "plain_table_db_test",
1293        "db/plain_table_db_test.cc",
1294        "serial",
1295        [],
1296        [],
1297    ],
1298    [
1299        "prefix_test",
1300        "db/prefix_test.cc",
1301        "serial",
1302        [],
1303        [],
1304    ],
1305    [
1306        "random_access_file_reader_test",
1307        "file/random_access_file_reader_test.cc",
1308        "serial",
1309        [],
1310        [],
1311    ],
1312    [
1313        "random_test",
1314        "util/random_test.cc",
1315        "serial",
1316        [],
1317        [],
1318    ],
1319    [
1320        "range_del_aggregator_test",
1321        "db/range_del_aggregator_test.cc",
1322        "serial",
1323        [],
1324        [],
1325    ],
1326    [
1327        "range_tombstone_fragmenter_test",
1328        "db/range_tombstone_fragmenter_test.cc",
1329        "serial",
1330        [],
1331        [],
1332    ],
1333    [
1334        "rate_limiter_test",
1335        "util/rate_limiter_test.cc",
1336        "serial",
1337        [],
1338        [],
1339    ],
1340    [
1341        "reduce_levels_test",
1342        "tools/reduce_levels_test.cc",
1343        "serial",
1344        [],
1345        [],
1346    ],
1347    [
1348        "repair_test",
1349        "db/repair_test.cc",
1350        "serial",
1351        [],
1352        [],
1353    ],
1354    [
1355        "repeatable_thread_test",
1356        "util/repeatable_thread_test.cc",
1357        "serial",
1358        [],
1359        [],
1360    ],
1361    [
1362        "sim_cache_test",
1363        "utilities/simulator_cache/sim_cache_test.cc",
1364        "serial",
1365        [],
1366        [],
1367    ],
1368    [
1369        "skiplist_test",
1370        "memtable/skiplist_test.cc",
1371        "serial",
1372        [],
1373        [],
1374    ],
1375    [
1376        "slice_test",
1377        "util/slice_test.cc",
1378        "serial",
1379        [],
1380        [],
1381    ],
1382    [
1383        "slice_transform_test",
1384        "util/slice_transform_test.cc",
1385        "serial",
1386        [],
1387        [],
1388    ],
1389    [
1390        "sst_dump_test",
1391        "tools/sst_dump_test.cc",
1392        "serial",
1393        [],
1394        [],
1395    ],
1396    [
1397        "sst_file_reader_test",
1398        "table/sst_file_reader_test.cc",
1399        "serial",
1400        [],
1401        [],
1402    ],
1403    [
1404        "statistics_test",
1405        "monitoring/statistics_test.cc",
1406        "serial",
1407        [],
1408        [],
1409    ],
1410    [
1411        "stats_history_test",
1412        "monitoring/stats_history_test.cc",
1413        "serial",
1414        [],
1415        [],
1416    ],
1417    [
1418        "stringappend_test",
1419        "utilities/merge_operators/string_append/stringappend_test.cc",
1420        "serial",
1421        [],
1422        [],
1423    ],
1424    [
1425        "table_properties_collector_test",
1426        "db/table_properties_collector_test.cc",
1427        "serial",
1428        [],
1429        [],
1430    ],
1431    [
1432        "table_test",
1433        "table/table_test.cc",
1434        "parallel",
1435        [],
1436        [],
1437    ],
1438    [
1439        "thread_list_test",
1440        "util/thread_list_test.cc",
1441        "serial",
1442        [],
1443        [],
1444    ],
1445    [
1446        "thread_local_test",
1447        "util/thread_local_test.cc",
1448        "serial",
1449        [],
1450        [],
1451    ],
1452    [
1453        "timer_queue_test",
1454        "util/timer_queue_test.cc",
1455        "serial",
1456        [],
1457        [],
1458    ],
1459    [
1460        "trace_analyzer_test",
1461        "tools/trace_analyzer_test.cc",
1462        "serial",
1463        [],
1464        [],
1465    ],
1466    [
1467        "transaction_test",
1468        "utilities/transactions/transaction_test.cc",
1469        "parallel",
1470        [],
1471        [],
1472    ],
1473    [
1474        "ttl_test",
1475        "utilities/ttl/ttl_test.cc",
1476        "serial",
1477        [],
1478        [],
1479    ],
1480    [
1481        "util_merge_operators_test",
1482        "utilities/util_merge_operators_test.cc",
1483        "serial",
1484        [],
1485        [],
1486    ],
1487    [
1488        "version_builder_test",
1489        "db/version_builder_test.cc",
1490        "serial",
1491        [],
1492        [],
1493    ],
1494    [
1495        "version_edit_test",
1496        "db/version_edit_test.cc",
1497        "serial",
1498        [],
1499        [],
1500    ],
1501    [
1502        "version_set_test",
1503        "db/version_set_test.cc",
1504        "serial",
1505        [],
1506        [],
1507    ],
1508    [
1509        "wal_manager_test",
1510        "db/wal_manager_test.cc",
1511        "serial",
1512        [],
1513        [],
1514    ],
1515    [
1516        "write_batch_test",
1517        "db/write_batch_test.cc",
1518        "serial",
1519        [],
1520        [],
1521    ],
1522    [
1523        "write_batch_with_index_test",
1524        "utilities/write_batch_with_index/write_batch_with_index_test.cc",
1525        "serial",
1526        [],
1527        [],
1528    ],
1529    [
1530        "write_buffer_manager_test",
1531        "memtable/write_buffer_manager_test.cc",
1532        "serial",
1533        [],
1534        [],
1535    ],
1536    [
1537        "write_callback_test",
1538        "db/write_callback_test.cc",
1539        "serial",
1540        [],
1541        [],
1542    ],
1543    [
1544        "write_controller_test",
1545        "db/write_controller_test.cc",
1546        "serial",
1547        [],
1548        [],
1549    ],
1550    [
1551        "write_prepared_transaction_test",
1552        "utilities/transactions/write_prepared_transaction_test.cc",
1553        "parallel",
1554        [],
1555        [],
1556    ],
1557    [
1558        "write_unprepared_transaction_test",
1559        "utilities/transactions/write_unprepared_transaction_test.cc",
1560        "parallel",
1561        [],
1562        [],
1563    ],
1564]
1565
1566# Generate a test rule for each entry in ROCKS_TESTS
1567# Do not build the tests in opt mode, since SyncPoint and other test code
1568# will not be included.
1569[
1570    test_binary(
1571        extra_compiler_flags = extra_compiler_flags,
1572        extra_deps = extra_deps,
1573        parallelism = parallelism,
1574        rocksdb_arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
1575        rocksdb_compiler_flags = ROCKSDB_COMPILER_FLAGS,
1576        rocksdb_external_deps = ROCKSDB_EXTERNAL_DEPS,
1577        rocksdb_os_deps = ROCKSDB_OS_DEPS,
1578        rocksdb_os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS,
1579        rocksdb_preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
1580        test_cc = test_cc,
1581        test_name = test_name,
1582    )
1583    for test_name, test_cc, parallelism, extra_deps, extra_compiler_flags in ROCKS_TESTS
1584    if not is_opt_mode
1585]
1586