diff options
author | 2021-01-29 12:48:05 -0500 | |
---|---|---|
committer | 2021-01-29 14:31:32 -0500 | |
commit | 9da4aa8166efe67d6c4ab1fe7911224d94493cc9 (patch) | |
tree | 655955ac8c4e54abea372e9499c642d00f7c5f50 /rust/androidmk.go | |
parent | 9436be43216d152265187c6d2eece38f9a10a9a7 (diff) |
rust: Allow rust_tests to include data files.
Adds the ability to define data files that should be installed alongside
the test.
This also fixes a bug wherein rust_test properties were duplicated.
Bug: 171710847
Test: rust_test module with "data" property installs files to device.
Change-Id: I091489afaf7e76b751a33a28049590d9fb39fe5f
Diffstat (limited to 'rust/androidmk.go')
-rw-r--r-- | rust/androidmk.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rust/androidmk.go b/rust/androidmk.go index 030772722..1a286f738 100644 --- a/rust/androidmk.go +++ b/rust/androidmk.go @@ -18,6 +18,7 @@ import ( "path/filepath" "android/soong/android" + "android/soong/cc" ) type AndroidMkContext interface { @@ -85,7 +86,8 @@ func (binary *binaryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.Andr } func (test *testDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { - test.binaryDecorator.AndroidMk(ctx, ret) + ctx.SubAndroidMk(ret, test.binaryDecorator) + ret.Class = "NATIVE_TESTS" ret.ExtraEntries = append(ret.ExtraEntries, func(entries *android.AndroidMkEntries) { entries.AddCompatibilityTestSuites(test.Properties.Test_suites...) @@ -95,7 +97,8 @@ func (test *testDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidM entries.SetBoolIfTrue("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", !BoolDefault(test.Properties.Auto_gen_config, true)) entries.SetBoolIfTrue("LOCAL_IS_UNIT_TEST", Bool(test.Properties.Test_options.Unit_test)) }) - // TODO(chh): add test data with androidMkWriteTestData(test.data, ctx, ret) + + cc.AndroidMkWriteTestData(test.data, ret) } func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |