third_party_rust_cxx/tests/BUILD

60 lines
1014 B
Python
Raw Normal View History

load("@rules_cc//cc:defs.bzl", "cc_library")
load("//tools/bazel:rust.bzl", "rust_library", "rust_test")
load("//tools/bazel:rust_cxx_bridge.bzl", "rust_cxx_bridge")
rust_test(
name = "test",
size = "small",
srcs = ["test.rs"],
deps = [
":cxx_test_suite",
"//:cxx",
],
)
rust_library(
name = "cxx_test_suite",
2020-05-08 09:16:29 +00:00
srcs = [
2020-10-10 23:19:20 +00:00
"ffi/extra.rs",
2020-05-08 09:16:29 +00:00
"ffi/lib.rs",
"ffi/module.rs",
],
deps = [
":impl",
"//:cxx",
],
)
cc_library(
name = "impl",
srcs = [
"ffi/tests.cc",
":bridge/source",
2020-10-10 23:19:20 +00:00
":extra/source",
2020-10-10 23:29:58 +00:00
":module/source",
],
hdrs = ["ffi/tests.h"],
deps = [
":bridge/include",
"//:core",
],
)
rust_cxx_bridge(
name = "bridge",
src = "ffi/lib.rs",
deps = [":impl"],
)
2020-05-08 09:16:29 +00:00
rust_cxx_bridge(
2020-10-10 23:29:58 +00:00
name = "extra",
src = "ffi/extra.rs",
deps = [":impl"],
2020-05-08 09:16:29 +00:00
)
2020-10-10 23:19:20 +00:00
rust_cxx_bridge(
2020-10-10 23:29:58 +00:00
name = "module",
src = "ffi/module.rs",
2020-10-10 23:19:20 +00:00
deps = [":impl"],
)