summaryrefslogtreecommitdiffstats
path: root/src/rocksdb/defs.bzl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/rocksdb/defs.bzl
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rocksdb/defs.bzl')
-rw-r--r--src/rocksdb/defs.bzl31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/rocksdb/defs.bzl b/src/rocksdb/defs.bzl
new file mode 100644
index 00000000..4468cebd
--- /dev/null
+++ b/src/rocksdb/defs.bzl
@@ -0,0 +1,31 @@
+load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary")
+load("@fbcode_macros//build_defs:custom_unittest.bzl", "custom_unittest")
+
+def test_binary(
+ test_name,
+ test_cc,
+ parallelism,
+ rocksdb_arch_preprocessor_flags,
+ rocksdb_compiler_flags,
+ rocksdb_preprocessor_flags,
+ rocksdb_external_deps):
+ TEST_RUNNER = native.package_name() + "/buckifier/rocks_test_runner.sh"
+
+ ttype = "gtest" if parallelism == "parallel" else "simple"
+ test_bin = test_name + "_bin"
+
+ cpp_binary(
+ name = test_bin,
+ srcs = [test_cc],
+ arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
+ compiler_flags = rocksdb_compiler_flags,
+ preprocessor_flags = rocksdb_preprocessor_flags,
+ deps = [":rocksdb_test_lib"],
+ external_deps = rocksdb_external_deps,
+ )
+
+ custom_unittest(
+ name = test_name,
+ command = [TEST_RUNNER, "$(location :{})".format(test_bin)],
+ type = ttype,
+ )