Attach rust_benchmark to atest and tradefed.

Automatically generate required tradefed configs for rust benchmarks so
that they're available in atest.

Test: atest <module with rust_benchmark defined>
Bug: 155309706
Change-Id: I6002100367a66b6b0555614acc6cebb00dbf435d
This commit is contained in:
Jakub Kotur
2021-01-15 15:57:27 +01:00
parent 1d640d0521
commit 546ccd5614
5 changed files with 77 additions and 0 deletions

View File

@@ -245,6 +245,25 @@ func AutoGenRustTestConfig(ctx android.ModuleContext, testConfigProp *string,
return path
}
func AutoGenRustBenchmarkConfig(ctx android.ModuleContext, testConfigProp *string,
testConfigTemplateProp *string, testSuites []string, config []Config, autoGenConfig *bool) android.Path {
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites, autoGenConfig, testConfigTemplateProp)
if autogenPath != nil {
templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp)
if templatePath.Valid() {
autogenTemplate(ctx, autogenPath, templatePath.String(), config, "")
} else {
if ctx.Device() {
autogenTemplate(ctx, autogenPath, "${RustDeviceBenchmarkConfigTemplate}", config, "")
} else {
autogenTemplate(ctx, autogenPath, "${RustHostBenchmarkConfigTemplate}", config, "")
}
}
return autogenPath
}
return path
}
func AutoGenRobolectricTestConfig(ctx android.ModuleContext, testConfigProp *string, testConfigTemplateProp *string,
testSuites []string, autoGenConfig *bool) android.Path {
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites, autoGenConfig, testConfigTemplateProp)