summaryrefslogtreecommitdiff
path: root/rust/androidmk.go
diff options
context:
space:
mode:
author Jakub Kotur <qtr@google.com> 2021-01-15 15:57:27 +0100
committer Jakub Kotur <qtr@google.com> 2021-04-06 12:40:34 +0200
commit546ccd5614553b35730c3b7b1778e337b0ba24ce (patch)
tree6e94ee839905e6256f58c0f9dcec983c783e055d /rust/androidmk.go
parent1d640d0521c7b266bb4b44726305ba2b9971f01d (diff)
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
Diffstat (limited to 'rust/androidmk.go')
-rw-r--r--rust/androidmk.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/rust/androidmk.go b/rust/androidmk.go
index 0f9a17d99..eda2bb4ea 100644
--- a/rust/androidmk.go
+++ b/rust/androidmk.go
@@ -102,6 +102,20 @@ func (test *testDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidM
cc.AndroidMkWriteTestData(test.data, ret)
}
+func (benchmark *benchmarkDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) {
+ benchmark.binaryDecorator.AndroidMk(ctx, ret)
+ ret.Class = "NATIVE_TESTS"
+ ret.ExtraEntries = append(ret.ExtraEntries,
+ func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
+ entries.AddCompatibilityTestSuites(benchmark.Properties.Test_suites...)
+ if benchmark.testConfig != nil {
+ entries.SetString("LOCAL_FULL_TEST_CONFIG", benchmark.testConfig.String())
+ }
+ entries.SetBool("LOCAL_NATIVE_BENCHMARK", true)
+ entries.SetBoolIfTrue("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", !BoolDefault(benchmark.Properties.Auto_gen_config, true))
+ })
+}
+
func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) {
ctx.SubAndroidMk(ret, library.baseCompiler)