blob: 74ce5ac3c4b8e4ed5242c7a19b18ed56aad4242a [file]
# Protocol Buffers - Google's data interchange format
# Copyright 2026 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
# This package contains tests exercising C++/Rust interop in the cpp kernel.
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_rust//rust:defs.bzl", "rust_test")
load("//bazel:cc_proto_library.bzl", "cc_proto_library")
load("//bazel:proto_library.bzl", "proto_library")
load(
"//rust:defs.bzl",
"rust_cc_proto_library",
)
package(default_applicable_licenses = ["//:license"])
cc_library(
name = "test_utils",
srcs = ["test_utils.cc"],
deps = [
":interop_test_cc_proto",
"//rust:cpp_api",
"//src/google/protobuf",
"@abseil-cpp//absl/log:absl_check",
"@abseil-cpp//absl/strings",
],
alwayslink = 1,
)
rust_test(
name = "interop_test",
srcs = ["main.rs"],
edition = "2024",
deps = [
":interop_test_cpp_rust_proto",
":test_utils",
"//rust:protobuf_cpp",
"@crate_index//:googletest",
],
)
rust_test(
name = "message_lite_test",
srcs = ["message_lite_test.rs"],
edition = "2024",
deps = [
":interop_test_cpp_rust_proto",
"//rust:protobuf_cpp",
"@crate_index//:googletest",
],
)
proto_library(
name = "interop_test_proto",
srcs = ["interop_test.proto"],
)
cc_proto_library(
name = "interop_test_cc_proto",
deps = [":interop_test_proto"],
)
rust_cc_proto_library(
name = "interop_test_cpp_rust_proto",
deps = [":interop_test_proto"],
)