Move some :unittest_(cpp|upb)_rust_proto target to be colocated with the .proto file that defines them

This CL doesn't unbreak the bazel tests, but is yak shaving in prep for changes that will. This makes it more straightforward how the tests are broken by having bazel test rules name rust proto library targets that don't exist in bazel repo, instead of naming targets that do exist but are bogus.

Also correct unittest_edition target to match the order of words in the .proto file name (edition_unittest)

PiperOrigin-RevId: 674295376
pull/18306/head
Protobuf Team Bot 4 months ago committed by Copybara-Service
parent ea0ade331f
commit 4834eb75cb
  1. 76
      rust/test/BUILD
  2. 2
      rust/test/cpp/interop/BUILD
  3. 76
      rust/test/shared/BUILD
  4. 2
      rust/test/shared/gtest_matchers_test.rs
  5. 2
      rust/test/shared/serialization_test.rs
  6. 6
      rust/test/upb/BUILD

@ -10,82 +10,6 @@ load(
"rust_upb_proto_library",
)
UNITTEST_PROTO_TARGET = "//src/google/protobuf:test_protos"
UNITTEST_PROTO3_TARGET = "//src/google/protobuf:test_protos"
UNITTEST_PROTO3_OPTIONAL_TARGET = "//src/google/protobuf:test_protos"
UNITTEST_EDITION_TARGET = "//src/google/protobuf:test_protos"
rust_upb_proto_library(
name = "unittest_upb_rust_proto",
testonly = True,
visibility = [
"//rust/test/shared:__subpackages__",
"//rust/test/upb:__subpackages__",
],
deps = [UNITTEST_PROTO_TARGET],
)
rust_cc_proto_library(
name = "unittest_cpp_rust_proto",
testonly = True,
visibility = [
"//rust/test/cpp:__subpackages__",
"//rust/test/shared:__subpackages__",
],
deps = [UNITTEST_PROTO_TARGET],
)
rust_cc_proto_library(
name = "unittest_proto3_cpp_rust_proto",
testonly = True,
visibility = ["//rust/test/shared:__subpackages__"],
deps = [UNITTEST_PROTO3_TARGET],
)
rust_upb_proto_library(
name = "unittest_proto3_upb_rust_proto",
testonly = True,
visibility = [
"//rust/test/shared:__subpackages__",
"//rust/test/upb:__subpackages__",
],
deps = [UNITTEST_PROTO3_TARGET],
)
rust_cc_proto_library(
name = "unittest_proto3_optional_cpp_rust_proto",
testonly = True,
visibility = ["//rust/test/shared:__subpackages__"],
deps = [UNITTEST_PROTO3_OPTIONAL_TARGET],
)
rust_upb_proto_library(
name = "unittest_proto3_optional_upb_rust_proto",
testonly = True,
visibility = ["//rust/test/shared:__subpackages__"],
deps = [UNITTEST_PROTO3_OPTIONAL_TARGET],
)
rust_cc_proto_library(
name = "unittest_edition_cpp_rust_proto",
testonly = True,
visibility = ["//rust/test/shared:__subpackages__"],
deps = [UNITTEST_EDITION_TARGET],
)
rust_upb_proto_library(
name = "unittest_edition_upb_rust_proto",
testonly = True,
visibility = [
"//rust/test/shared:__subpackages__",
"//rust/test/upb:__subpackages__",
],
deps = [UNITTEST_EDITION_TARGET],
)
proto_library(
name = "parent_proto",
srcs = ["parent.proto"],

@ -19,7 +19,7 @@ rust_test(
deps = [
":test_utils",
"//rust:protobuf_cpp",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)

@ -24,7 +24,7 @@ rust_test(
},
deps = [
"//rust:protobuf_upb_export",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -37,7 +37,7 @@ rust_test(
},
deps = [
"//rust:protobuf_cpp_export",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -97,7 +97,7 @@ rust_test(
deps = [
"//rust:protobuf_cpp_export",
"//rust/test:enums_cpp_rust_proto",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -111,7 +111,7 @@ rust_test(
deps = [
"//rust:protobuf_upb_export",
"//rust/test:enums_upb_rust_proto",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -173,7 +173,7 @@ rust_test(
srcs = ["bad_names_test.rs"],
deps = [
"//rust/test:bad_names_cpp_rust_proto",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -186,7 +186,7 @@ rust_test(
# deps = [
# "@crate_index//:googletest",
# "//rust/test:bad_names_upb_rust_proto",
# "//rust/test:unittest_upb_rust_proto",
# "//src/google/protobuf:unittest_upb_rust_proto",
# ],
# )
@ -194,7 +194,7 @@ rust_test(
name = "nested_types_cpp_test",
srcs = ["nested_types_test.rs"],
deps = [
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -203,7 +203,7 @@ rust_test(
name = "nested_types_upb_test",
srcs = ["nested_types_test.rs"],
deps = [
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -219,7 +219,7 @@ rust_test(
],
deps = [
"//rust:protobuf_cpp_export",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -235,7 +235,7 @@ rust_test(
],
deps = [
"//rust:protobuf_upb_export",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -248,8 +248,8 @@ rust_test(
},
deps = [
"//rust:protobuf_cpp_export",
"//rust/test:unittest_proto3_cpp_rust_proto",
"//rust/test:unittest_proto3_optional_cpp_rust_proto",
"//src/google/protobuf:unittest_proto3_cpp_rust_proto",
"//src/google/protobuf:unittest_proto3_optional_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -262,8 +262,8 @@ rust_test(
},
deps = [
"//rust:protobuf_upb_export",
"//rust/test:unittest_proto3_optional_upb_rust_proto",
"//rust/test:unittest_proto3_upb_rust_proto",
"//src/google/protobuf:unittest_proto3_optional_upb_rust_proto",
"//src/google/protobuf:unittest_proto3_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -279,10 +279,10 @@ rust_test(
],
deps = [
"//rust:protobuf_upb_export",
"//rust/test:unittest_edition_upb_rust_proto",
"//rust/test:unittest_proto3_optional_upb_rust_proto",
"//rust/test:unittest_proto3_upb_rust_proto",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:edition_unittest_upb_rust_proto",
"//src/google/protobuf:unittest_proto3_optional_upb_rust_proto",
"//src/google/protobuf:unittest_proto3_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -298,10 +298,10 @@ rust_test(
],
deps = [
"//rust:protobuf_cpp_export",
"//rust/test:unittest_cpp_rust_proto",
"//rust/test:unittest_edition_cpp_rust_proto",
"//rust/test:unittest_proto3_cpp_rust_proto",
"//rust/test:unittest_proto3_optional_cpp_rust_proto",
"//src/google/protobuf:edition_unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_proto3_cpp_rust_proto",
"//src/google/protobuf:unittest_proto3_optional_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -343,7 +343,7 @@ rust_test(
],
deps = [
"//rust:protobuf_cpp_export",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -359,7 +359,7 @@ rust_test(
],
deps = [
"//rust:protobuf_upb_export",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -377,7 +377,7 @@ rust_test(
"//rust:protobuf_cpp_export",
"//rust/test:enums_cpp_rust_proto",
"//rust/test:map_unittest_cpp_rust_proto",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -395,7 +395,7 @@ rust_test(
"//rust:protobuf_upb_export",
"//rust/test:enums_upb_rust_proto",
"//rust/test:map_unittest_upb_rust_proto",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -430,7 +430,7 @@ rust_test(
},
deps = [
"//rust:protobuf_cpp",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -443,7 +443,7 @@ rust_test(
},
deps = [
"//rust:protobuf_upb",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -456,7 +456,7 @@ rust_test(
},
deps = [
"//rust:protobuf_cpp",
"//rust/test:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -471,7 +471,7 @@ rust_test(
deps = [
"//rust:protobuf_gtest_matchers_upb",
"//rust:protobuf_upb",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -489,10 +489,10 @@ rust_test(
deps = [
"//rust:protobuf_cpp",
"//rust:protobuf_gtest_matchers_cpp",
"//rust/test:unittest_cpp_rust_proto",
"//rust/test:unittest_edition_cpp_rust_proto",
"//rust/test:unittest_proto3_cpp_rust_proto",
"//rust/test:unittest_proto3_optional_cpp_rust_proto",
"//src/google/protobuf:edition_unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_cpp_rust_proto",
"//src/google/protobuf:unittest_proto3_cpp_rust_proto",
"//src/google/protobuf:unittest_proto3_optional_cpp_rust_proto",
"@crate_index//:googletest",
],
)
@ -510,10 +510,10 @@ rust_test(
deps = [
"//rust:protobuf_gtest_matchers_upb",
"//rust:protobuf_upb",
"//rust/test:unittest_edition_upb_rust_proto",
"//rust/test:unittest_proto3_optional_upb_rust_proto",
"//rust/test:unittest_proto3_upb_rust_proto",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:edition_unittest_upb_rust_proto",
"//src/google/protobuf:unittest_proto3_optional_upb_rust_proto",
"//src/google/protobuf:unittest_proto3_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)

@ -5,10 +5,10 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
use edition_unittest_rust_proto::TestAllTypes as TestAllTypesEditions;
use googletest::prelude::*;
use paste::paste;
use protobuf_gtest_matchers::proto_eq;
use unittest_edition_rust_proto::TestAllTypes as TestAllTypesEditions;
use unittest_proto3_rust_proto::TestAllTypes as TestAllTypesProto3;
use unittest_rust_proto::TestAllTypes as TestAllTypesProto2;

@ -8,8 +8,8 @@
use googletest::prelude::*;
use protobuf::prelude::*;
use edition_unittest_rust_proto::TestAllTypes as TestAllTypesEditions;
use paste::paste;
use unittest_edition_rust_proto::TestAllTypes as TestAllTypesEditions;
use unittest_proto3_optional_rust_proto::TestProto3Optional;
use unittest_proto3_rust_proto::TestAllTypes as TestAllTypesProto3;
use unittest_rust_proto::TestAllTypes as TestAllTypesProto2;

@ -32,7 +32,7 @@ rust_test(
},
deps = [
"//rust:protobuf_upb_export",
"//rust/test:unittest_proto3_upb_rust_proto",
"//src/google/protobuf:unittest_proto3_upb_rust_proto",
"@crate_index//:googletest",
],
)
@ -45,8 +45,8 @@ rust_test(
deps = [
"//rust:protobuf_upb",
"//rust/test:map_unittest_upb_rust_proto",
"//rust/test:unittest_edition_upb_rust_proto",
"//rust/test:unittest_upb_rust_proto",
"//src/google/protobuf:edition_unittest_upb_rust_proto",
"//src/google/protobuf:unittest_upb_rust_proto",
"@crate_index//:googletest",
],
)

Loading…
Cancel
Save