bloaty: measure stripped Rust binaries
Modify bloaty's MeasureSizeForPath to allow a module to provide multiple
paths. This is used to measure both unstripped and stripped
libraries/binaries. Add unit test to ensure correct measurements are
generated for Rust.
Test: m out/soong/binary_sizes.pb.gz
Change-Id: I59439b77dbf1cf5ad71e1c02996a6a90938536b4
diff --git a/rust/testing.go b/rust/testing.go
index 1e01cc0..10b768c 100644
--- a/rust/testing.go
+++ b/rust/testing.go
@@ -16,6 +16,7 @@
import (
"android/soong/android"
+ "android/soong/bloaty"
"android/soong/cc"
)
@@ -34,6 +35,7 @@
// Preparer that will define default rust modules, e.g. standard prebuilt modules.
var PrepareForTestWithRustDefaultModules = android.GroupFixturePreparers(
cc.PrepareForTestWithCcDefaultModules,
+ bloaty.PrepareForTestWithBloatyDefaultModules,
PrepareForTestWithRustBuildComponents,
android.FixtureAddTextFile(rustDefaultsDir+"Android.bp", GatherRequiredDepsForTest()),
)