diff --git a/cc/androidmk.go b/cc/androidmk.go index 481dbb4c2..f853b1355 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -200,6 +200,13 @@ func (binary *binaryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.Andr func (benchmark *benchmarkDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) { ctx.subAndroidMk(ret, benchmark.binaryDecorator) + ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error { + if len(benchmark.Properties.Test_suites) > 0 { + fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=", + strings.Join(benchmark.Properties.Test_suites, " ")) + } + return nil + }) } func (test *testBinary) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) { diff --git a/cc/test.go b/cc/test.go index 145b5b088..448f089b2 100644 --- a/cc/test.go +++ b/cc/test.go @@ -299,8 +299,15 @@ func NewTestLibrary(hod android.HostOrDeviceSupported) *Module { return module } +type BenchmarkProperties struct { + // list of compatibility suites (for example "cts", "vts") that the module should be + // installed into. + Test_suites []string +} + type benchmarkDecorator struct { *binaryDecorator + Properties BenchmarkProperties } func (benchmark *benchmarkDecorator) linkerInit(ctx BaseModuleContext) { @@ -312,6 +319,12 @@ func (benchmark *benchmarkDecorator) linkerInit(ctx BaseModuleContext) { benchmark.binaryDecorator.linkerInit(ctx) } +func (benchmark *benchmarkDecorator) linkerProps() []interface{} { + props := benchmark.binaryDecorator.linkerProps() + props = append(props, &benchmark.Properties) + return props +} + func (benchmark *benchmarkDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { deps = benchmark.binaryDecorator.linkerDeps(ctx, deps) deps.StaticLibs = append(deps.StaticLibs, "libgoogle-benchmark")