Add rust_benchmark module to soong.
This commit adds rust_benchmark and rust_benchmark_host commands to
soong. Respectively running rust benchmarks on device and host. Currently
only criterion based benchmarks are supported and criterion library is
automatically linked.
Test: atest <module with rust_benchmark defined>
Bug: 155309706
Change-Id: I6edfc2b4bf30b1163fe59b8c2ecdcd4e7125e7b9
diff --git a/rust/testing.go b/rust/testing.go
index 75adcfc..1e01cc0 100644
--- a/rust/testing.go
+++ b/rust/testing.go
@@ -192,11 +192,19 @@
srcs:["foo.rs"],
host_supported: true,
}
+ rust_library {
+ name: "libcriterion",
+ crate_name: "criterion",
+ srcs:["foo.rs"],
+ host_supported: true,
+ }
`
return bp
}
func registerRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
+ ctx.RegisterModuleType("rust_benchmark", RustBenchmarkFactory)
+ ctx.RegisterModuleType("rust_benchmark_host", RustBenchmarkHostFactory)
ctx.RegisterModuleType("rust_binary", RustBinaryFactory)
ctx.RegisterModuleType("rust_binary_host", RustBinaryHostFactory)
ctx.RegisterModuleType("rust_bindgen", RustBindgenFactory)