summaryrefslogtreecommitdiff
path: root/rust/protobuf_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/protobuf_test.go')
-rw-r--r--rust/protobuf_test.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/rust/protobuf_test.go b/rust/protobuf_test.go
index 845911f75..608a4e819 100644
--- a/rust/protobuf_test.go
+++ b/rust/protobuf_test.go
@@ -25,7 +25,7 @@ func TestRustProtobuf(t *testing.T) {
ctx := testRust(t, `
rust_protobuf {
name: "librust_proto",
- proto: "buf.proto",
+ protos: ["buf.proto", "proto.proto"],
crate_name: "rust_proto",
source_stem: "buf",
shared_libs: ["libfoo_shared"],
@@ -60,13 +60,20 @@ func TestRustProtobuf(t *testing.T) {
if w := "-Istatic_include"; !strings.Contains(cmd, w) {
t.Errorf("expected %q in %q", w, cmd)
}
+
+ // Check proto.rs, the second protobuf, is listed as an output
+ librust_proto_outputs := ctx.ModuleForTests("librust_proto", "android_arm64_armv8-a_source").AllOutputs()
+ if android.InList("proto.rs", librust_proto_outputs) {
+ t.Errorf("rust_protobuf is not producing multiple outputs; expected 'proto.rs' in list, got: %#v ",
+ librust_proto_outputs)
+ }
}
func TestRustGrpcio(t *testing.T) {
ctx := testRust(t, `
rust_grpcio {
name: "librust_grpcio",
- proto: "buf.proto",
+ protos: ["buf.proto", "proto.proto"],
crate_name: "rust_grpcio",
source_stem: "buf",
shared_libs: ["libfoo_shared"],
@@ -117,4 +124,11 @@ func TestRustGrpcio(t *testing.T) {
if w := "-Ilibprotobuf-cpp-full-includes"; !strings.Contains(cmd, w) {
t.Errorf("expected %q in %q", w, cmd)
}
+
+ // Check proto.rs, the second protobuf, is listed as an output
+ librust_grpcio_outputs := ctx.ModuleForTests("librust_grpcio", "android_arm64_armv8-a_source").AllOutputs()
+ if android.InList("proto_grpc.rs", librust_grpcio_outputs) {
+ t.Errorf("rust_protobuf is not producing multiple outputs; expected 'proto_grpc.rs' in list, got: %#v ",
+ librust_grpcio_outputs)
+ }
}