summaryrefslogtreecommitdiff
path: root/rust/testing.go
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-08-21 10:01:58 +0000
committerIvan Lozano <ivanlozano@google.com>2020-08-31 14:05:39 -0400
commit588aae727bf352a1512a69c92e0af330977f01d3 (patch)
tree2265b96a7ecb1a59027b7dafe3809cc2097885b6 /rust/testing.go
parent682c9d7b2538f8f7f2185296b91abf04835912fc (diff)
Add rust_protobuf module.
This adds a new SourceProvider module type to handle protobuf code generation. See the new test for an example of how to call this. Bug: 143953733 Test: New soong tests pass. Test: Replacing genrules in crosvm with rust_protobuf modules. Change-Id: Ie3117129cde37b8736bc18ee09bf5cde27c01c34
Diffstat (limited to 'rust/testing.go')
-rw-r--r--rust/testing.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/testing.go b/rust/testing.go
index 80e414871..0144c8218 100644
--- a/rust/testing.go
+++ b/rust/testing.go
@@ -91,6 +91,12 @@ func GatherRequiredDepsForTest() string {
host_supported: true,
native_coverage: false,
}
+ rust_library {
+ name: "libprotobuf",
+ crate_name: "protobuf",
+ srcs: ["foo.rs"],
+ host_supported: true,
+ }
` + cc.GatherRequiredDepsForTest(android.NoOsType)
return bp
@@ -120,6 +126,8 @@ func CreateTestContext() *android.TestContext {
ctx.RegisterModuleType("rust_ffi_host_shared", RustFFISharedHostFactory)
ctx.RegisterModuleType("rust_ffi_host_static", RustFFIStaticHostFactory)
ctx.RegisterModuleType("rust_proc_macro", ProcMacroFactory)
+ ctx.RegisterModuleType("rust_protobuf", RustProtobufFactory)
+ ctx.RegisterModuleType("rust_protobuf_host", RustProtobufHostFactory)
ctx.RegisterModuleType("rust_prebuilt_library", PrebuiltLibraryFactory)
ctx.RegisterModuleType("rust_prebuilt_dylib", PrebuiltDylibFactory)
ctx.RegisterModuleType("rust_prebuilt_rlib", PrebuiltRlibFactory)