Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 1 | // Copyright 2019 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package rust |
| 16 | |
| 17 | import ( |
Jooyung Han | 10bea7d | 2022-04-29 02:04:30 +0900 | [diff] [blame] | 18 | "path/filepath" |
| 19 | |
Julien Desprez | 84c9494 | 2021-01-15 15:10:01 -0800 | [diff] [blame] | 20 | "github.com/google/blueprint/proptools" |
| 21 | |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 22 | "android/soong/android" |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 23 | "android/soong/cc" |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 24 | "android/soong/tradefed" |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 25 | ) |
| 26 | |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 27 | type TestProperties struct { |
Ivan Lozano | fc80fe7 | 2020-06-11 13:25:36 -0400 | [diff] [blame] | 28 | // Disables the creation of a test-specific directory when used with |
| 29 | // relative_install_path. Useful if several tests need to be in the same |
Colin Cross | 3a02c7b | 2024-05-21 13:46:22 -0700 | [diff] [blame] | 30 | // directory. |
Ivan Lozano | fc80fe7 | 2020-06-11 13:25:36 -0400 | [diff] [blame] | 31 | No_named_install_directory *bool |
| 32 | |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 33 | // the name of the test configuration (for example "AndroidTest.xml") that should be |
| 34 | // installed with the module. |
Colin Cross | a638482 | 2020-06-09 15:09:22 -0700 | [diff] [blame] | 35 | Test_config *string `android:"path,arch_variant"` |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 36 | |
| 37 | // the name of the test configuration template (for example "AndroidTestTemplate.xml") that |
| 38 | // should be installed with the module. |
Colin Cross | a638482 | 2020-06-09 15:09:22 -0700 | [diff] [blame] | 39 | Test_config_template *string `android:"path,arch_variant"` |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 40 | |
| 41 | // list of compatibility suites (for example "cts", "vts") that the module should be |
| 42 | // installed into. |
| 43 | Test_suites []string `android:"arch_variant"` |
| 44 | |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 45 | // list of files or filegroup modules that provide data that should be installed alongside |
| 46 | // the test |
| 47 | Data []string `android:"path,arch_variant"` |
| 48 | |
Cole Faust | 65cb40a | 2024-10-21 15:41:42 -0700 | [diff] [blame] | 49 | // Same as data, but will add dependencies on the device's |
| 50 | Device_common_data []string `android:"path_device_common"` |
| 51 | |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 52 | // list of shared library modules that should be installed alongside the test |
| 53 | Data_libs []string `android:"arch_variant"` |
| 54 | |
| 55 | // list of binary modules that should be installed alongside the test |
| 56 | Data_bins []string `android:"arch_variant"` |
| 57 | |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 58 | // Flag to indicate whether or not to create test config automatically. If AndroidTest.xml |
| 59 | // doesn't exist next to the Android.bp, this attribute doesn't need to be set to true |
| 60 | // explicitly. |
| 61 | Auto_gen_config *bool |
Stephen Crane | 02a623d | 2020-04-25 21:40:35 -0700 | [diff] [blame] | 62 | |
| 63 | // if set, build with the standard Rust test harness. Defaults to true. |
| 64 | Test_harness *bool |
Dan Shi | d79572f | 2020-11-13 14:33:46 -0800 | [diff] [blame] | 65 | |
| 66 | // Test options. |
Zhenhuang Wang | 0ac5a43 | 2022-08-12 18:49:20 +0800 | [diff] [blame] | 67 | Test_options android.CommonTestOptions |
Ivan Lozano | ba22261 | 2021-09-21 10:49:13 -0400 | [diff] [blame] | 68 | |
| 69 | // Add RootTargetPreparer to auto generated test config. This guarantees the test to run |
| 70 | // with root permission. |
| 71 | Require_root *bool |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 74 | // A test module is a binary module with extra --test compiler flag |
| 75 | // and different default installation directory. |
| 76 | // In golang, inheriance is written as a component. |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 77 | type testDecorator struct { |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 78 | *binaryDecorator |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 79 | Properties TestProperties |
| 80 | testConfig android.Path |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 81 | |
| 82 | data []android.DataPath |
| 83 | } |
| 84 | |
| 85 | func (test *testDecorator) dataPaths() []android.DataPath { |
| 86 | return test.data |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 87 | } |
| 88 | |
Ivan Lozano | a0cd8f9 | 2020-04-09 09:56:02 -0400 | [diff] [blame] | 89 | func (test *testDecorator) nativeCoverage() bool { |
| 90 | return true |
| 91 | } |
| 92 | |
Stephen Crane | 02a623d | 2020-04-25 21:40:35 -0700 | [diff] [blame] | 93 | func (test *testDecorator) testHarness() bool { |
| 94 | return BoolDefault(test.Properties.Test_harness, true) |
| 95 | } |
| 96 | |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 97 | func NewRustTest(hod android.HostOrDeviceSupported) (*Module, *testDecorator) { |
Chih-Hung Hsieh | e728a89 | 2020-06-16 01:25:27 -0700 | [diff] [blame] | 98 | // Build both 32 and 64 targets for device tests. |
| 99 | // Cannot build both for host tests yet if the test depends on |
| 100 | // something like proc-macro2 that cannot be built for both. |
| 101 | multilib := android.MultilibBoth |
| 102 | if hod != android.DeviceSupported && hod != android.HostAndDeviceSupported { |
| 103 | multilib = android.MultilibFirst |
| 104 | } |
| 105 | module := newModule(hod, multilib) |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 106 | |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 107 | test := &testDecorator{ |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 108 | binaryDecorator: &binaryDecorator{ |
Chih-Hung Hsieh | 9a4a7ba | 2019-12-12 19:36:05 -0800 | [diff] [blame] | 109 | baseCompiler: NewBaseCompiler("nativetest", "nativetest64", InstallInData), |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 110 | }, |
| 111 | } |
| 112 | |
| 113 | module.compiler = test |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 114 | return module, test |
| 115 | } |
| 116 | |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 117 | func (test *testDecorator) compilerProps() []interface{} { |
| 118 | return append(test.binaryDecorator.compilerProps(), &test.Properties) |
| 119 | } |
| 120 | |
ThiƩbaud Weksteen | fabaff6 | 2020-08-27 13:48:36 +0200 | [diff] [blame] | 121 | func (test *testDecorator) install(ctx ModuleContext) { |
Nikita Putikhin | 5f23bc9 | 2024-07-05 15:08:01 +0200 | [diff] [blame] | 122 | // TODO: (b/167308193) Switch to /data/local/tests/unrestricted as the default install base. |
| 123 | testInstallBase := "/data/local/tmp" |
Kiyoung Kim | aa39480 | 2024-01-08 12:55:45 +0900 | [diff] [blame] | 124 | if ctx.RustModule().InVendorOrProduct() { |
Ivan Lozano | ba22261 | 2021-09-21 10:49:13 -0400 | [diff] [blame] | 125 | testInstallBase = "/data/local/tests/vendor" |
| 126 | } |
| 127 | |
| 128 | var configs []tradefed.Config |
| 129 | if Bool(test.Properties.Require_root) { |
| 130 | configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.RootTargetPreparer", nil}) |
| 131 | } else { |
| 132 | var options []tradefed.Option |
| 133 | options = append(options, tradefed.Option{Name: "force-root", Value: "false"}) |
| 134 | configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.RootTargetPreparer", options}) |
| 135 | } |
| 136 | |
Cole Faust | 2168054 | 2022-12-07 18:18:37 -0800 | [diff] [blame] | 137 | test.testConfig = tradefed.AutoGenTestConfig(ctx, tradefed.AutoGenTestConfigOptions{ |
| 138 | TestConfigProp: test.Properties.Test_config, |
| 139 | TestConfigTemplateProp: test.Properties.Test_config_template, |
| 140 | TestSuites: test.Properties.Test_suites, |
| 141 | Config: configs, |
| 142 | AutoGenConfig: test.Properties.Auto_gen_config, |
| 143 | TestInstallBase: testInstallBase, |
| 144 | DeviceTemplate: "${RustDeviceTestConfigTemplate}", |
| 145 | HostTemplate: "${RustHostTestConfigTemplate}", |
| 146 | }) |
Ivan Lozano | fc80fe7 | 2020-06-11 13:25:36 -0400 | [diff] [blame] | 147 | |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 148 | dataSrcPaths := android.PathsForModuleSrc(ctx, test.Properties.Data) |
Cole Faust | 65cb40a | 2024-10-21 15:41:42 -0700 | [diff] [blame] | 149 | dataSrcPaths = append(dataSrcPaths, android.PathsForModuleSrc(ctx, test.Properties.Device_common_data)...) |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 150 | |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 151 | ctx.VisitDirectDepsProxyWithTag(dataLibDepTag, func(dep android.ModuleProxy) { |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 152 | depName := ctx.OtherModuleName(dep) |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 153 | linkableDep, ok := android.OtherModuleProvider(ctx, dep, cc.LinkableInfoProvider) |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 154 | if !ok { |
| 155 | ctx.ModuleErrorf("data_lib %q is not a linkable module", depName) |
| 156 | } |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 157 | if linkableDep.OutputFile.Valid() { |
Jooyung Han | 10bea7d | 2022-04-29 02:04:30 +0900 | [diff] [blame] | 158 | // Copy the output in "lib[64]" so that it's compatible with |
| 159 | // the default rpath values. |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 160 | commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoKey) |
Jooyung Han | 10bea7d | 2022-04-29 02:04:30 +0900 | [diff] [blame] | 161 | libDir := "lib" |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 162 | if commonInfo.Target.Arch.ArchType.Multilib == "lib64" { |
Jooyung Han | 10bea7d | 2022-04-29 02:04:30 +0900 | [diff] [blame] | 163 | libDir = "lib64" |
| 164 | } |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 165 | test.data = append(test.data, |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 166 | android.DataPath{SrcPath: linkableDep.OutputFile.Path(), |
| 167 | RelativeInstallPath: filepath.Join(libDir, linkableDep.RelativeInstallPath)}) |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 168 | } |
| 169 | }) |
| 170 | |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 171 | ctx.VisitDirectDepsProxyWithTag(dataBinDepTag, func(dep android.ModuleProxy) { |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 172 | depName := ctx.OtherModuleName(dep) |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 173 | linkableDep, ok := android.OtherModuleProvider(ctx, dep, cc.LinkableInfoProvider) |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 174 | if !ok { |
| 175 | ctx.ModuleErrorf("data_bin %q is not a linkable module", depName) |
| 176 | } |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 177 | if linkableDep.OutputFile.Valid() { |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 178 | test.data = append(test.data, |
Yu Liu | 727204c | 2025-01-23 20:58:32 +0000 | [diff] [blame] | 179 | android.DataPath{SrcPath: linkableDep.OutputFile.Path(), |
| 180 | RelativeInstallPath: linkableDep.RelativeInstallPath}) |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 181 | } |
| 182 | }) |
| 183 | |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 184 | for _, dataSrcPath := range dataSrcPaths { |
| 185 | test.data = append(test.data, android.DataPath{SrcPath: dataSrcPath}) |
| 186 | } |
| 187 | |
Chih-Hung Hsieh | 9a4a7ba | 2019-12-12 19:36:05 -0800 | [diff] [blame] | 188 | // default relative install path is module name |
Ivan Lozano | fc80fe7 | 2020-06-11 13:25:36 -0400 | [diff] [blame] | 189 | if !Bool(test.Properties.No_named_install_directory) { |
Chih-Hung Hsieh | 9a4a7ba | 2019-12-12 19:36:05 -0800 | [diff] [blame] | 190 | test.baseCompiler.relative = ctx.ModuleName() |
Ivan Lozano | fc80fe7 | 2020-06-11 13:25:36 -0400 | [diff] [blame] | 191 | } else if String(test.baseCompiler.Properties.Relative_install_path) == "" { |
| 192 | ctx.PropertyErrorf("no_named_install_directory", "Module install directory may only be disabled if relative_install_path is set") |
Chih-Hung Hsieh | 9a4a7ba | 2019-12-12 19:36:05 -0800 | [diff] [blame] | 193 | } |
Ivan Lozano | fc80fe7 | 2020-06-11 13:25:36 -0400 | [diff] [blame] | 194 | |
Julien Desprez | 84c9494 | 2021-01-15 15:10:01 -0800 | [diff] [blame] | 195 | if ctx.Host() && test.Properties.Test_options.Unit_test == nil { |
| 196 | test.Properties.Test_options.Unit_test = proptools.BoolPtr(true) |
| 197 | } |
Spandan Das | 3094ba0 | 2025-01-29 20:57:02 +0000 | [diff] [blame^] | 198 | |
| 199 | if !ctx.Config().KatiEnabled() { // TODO(spandandas): Remove the special case for kati |
| 200 | // Install the test config in testcases/ directory for atest. |
| 201 | r, ok := ctx.Module().(*Module) |
| 202 | if !ok { |
| 203 | ctx.ModuleErrorf("Not a rust test module") |
| 204 | } |
| 205 | // Install configs in the root of $PRODUCT_OUT/testcases/$module |
| 206 | testCases := android.PathForModuleInPartitionInstall(ctx, "testcases", ctx.ModuleName()+r.SubName()) |
| 207 | if ctx.PrimaryArch() { |
| 208 | if test.testConfig != nil { |
| 209 | ctx.InstallFile(testCases, ctx.ModuleName()+".config", test.testConfig) |
| 210 | } |
| 211 | } |
| 212 | // Install tests and data in arch specific subdir $PRODUCT_OUT/testcases/$module/$arch |
| 213 | testCases = testCases.Join(ctx, ctx.Target().Arch.ArchType.String()) |
| 214 | ctx.InstallTestData(testCases, test.data) |
| 215 | testPath := ctx.RustModule().OutputFile().Path() |
| 216 | ctx.InstallFile(testCases, testPath.Base(), testPath) |
| 217 | } |
| 218 | |
Colin Cross | 5c1d5fb | 2023-11-15 12:39:40 -0800 | [diff] [blame] | 219 | test.binaryDecorator.installTestData(ctx, test.data) |
ThiƩbaud Weksteen | fabaff6 | 2020-08-27 13:48:36 +0200 | [diff] [blame] | 220 | test.binaryDecorator.install(ctx) |
Chih-Hung Hsieh | 41805be | 2019-10-31 20:56:47 -0700 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | func (test *testDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags { |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 224 | flags = test.binaryDecorator.compilerFlags(ctx, flags) |
Stephen Crane | 02a623d | 2020-04-25 21:40:35 -0700 | [diff] [blame] | 225 | if test.testHarness() { |
| 226 | flags.RustFlags = append(flags.RustFlags, "--test") |
Chris Wailes | 9da6e89 | 2025-01-27 13:46:43 -0800 | [diff] [blame] | 227 | flags.RustFlags = append(flags.RustFlags, "-A missing-docs") |
Stephen Crane | 02a623d | 2020-04-25 21:40:35 -0700 | [diff] [blame] | 228 | } |
Jeff Vander Stoep | bf7a902 | 2021-01-26 14:35:38 +0100 | [diff] [blame] | 229 | if ctx.Device() { |
| 230 | flags.RustFlags = append(flags.RustFlags, "-Z panic_abort_tests") |
| 231 | } |
Colin Cross | 225a37a | 2023-01-11 14:17:39 -0800 | [diff] [blame] | 232 | |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 233 | return flags |
| 234 | } |
| 235 | |
Liz Kammer | 356f7d4 | 2021-01-26 09:18:53 -0500 | [diff] [blame] | 236 | func (test *testDecorator) autoDep(ctx android.BottomUpMutatorContext) autoDep { |
Matthew Maurer | 0f003b1 | 2020-06-29 14:34:06 -0700 | [diff] [blame] | 237 | return rlibAutoDep |
| 238 | } |
| 239 | |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 240 | func init() { |
| 241 | // Rust tests are binary files built with --test. |
| 242 | android.RegisterModuleType("rust_test", RustTestFactory) |
| 243 | android.RegisterModuleType("rust_test_host", RustTestHostFactory) |
| 244 | } |
| 245 | |
| 246 | func RustTestFactory() android.Module { |
| 247 | module, _ := NewRustTest(android.HostAndDeviceSupported) |
Ivan Lozano | f5c98a2 | 2021-12-07 10:17:00 -0500 | [diff] [blame] | 248 | |
| 249 | // NewRustTest will set MultilibBoth true, however the host variant |
| 250 | // cannot produce the non-primary target. Therefore, add the |
| 251 | // rustTestHostMultilib load hook to set MultilibFirst for the |
| 252 | // host target. |
| 253 | android.AddLoadHook(module, rustTestHostMultilib) |
Aditya Choudhary | 87b2ab2 | 2023-11-17 15:27:06 +0000 | [diff] [blame] | 254 | module.testModule = true |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 255 | return module.Init() |
| 256 | } |
| 257 | |
| 258 | func RustTestHostFactory() android.Module { |
| 259 | module, _ := NewRustTest(android.HostSupported) |
Aditya Choudhary | 87b2ab2 | 2023-11-17 15:27:06 +0000 | [diff] [blame] | 260 | module.testModule = true |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 261 | return module.Init() |
| 262 | } |
Ivan Lozano | 2b08113 | 2020-09-08 12:46:52 -0400 | [diff] [blame] | 263 | |
Ivan Lozano | 806efd3 | 2024-12-11 21:38:53 +0000 | [diff] [blame] | 264 | func (test *testDecorator) stdLinkage(device bool) RustLinkage { |
Ivan Lozano | dd05547 | 2020-09-28 13:22:45 -0400 | [diff] [blame] | 265 | return RlibLinkage |
Ivan Lozano | 2b08113 | 2020-09-08 12:46:52 -0400 | [diff] [blame] | 266 | } |
Ivan Lozano | 3ee74c8 | 2021-07-15 15:44:10 -0400 | [diff] [blame] | 267 | |
| 268 | func (test *testDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps { |
| 269 | deps = test.binaryDecorator.compilerDeps(ctx, deps) |
| 270 | |
| 271 | deps.Rustlibs = append(deps.Rustlibs, "libtest") |
| 272 | |
Ivan Lozano | 4e5f07d | 2021-11-04 14:09:38 -0400 | [diff] [blame] | 273 | deps.DataLibs = append(deps.DataLibs, test.Properties.Data_libs...) |
| 274 | deps.DataBins = append(deps.DataBins, test.Properties.Data_bins...) |
| 275 | |
Ivan Lozano | 3ee74c8 | 2021-07-15 15:44:10 -0400 | [diff] [blame] | 276 | return deps |
| 277 | } |
Ivan Lozano | 62cd038 | 2021-11-01 10:27:54 -0400 | [diff] [blame] | 278 | |
| 279 | func (test *testDecorator) testBinary() bool { |
| 280 | return true |
| 281 | } |
Ivan Lozano | f5c98a2 | 2021-12-07 10:17:00 -0500 | [diff] [blame] | 282 | |
| 283 | func rustTestHostMultilib(ctx android.LoadHookContext) { |
| 284 | type props struct { |
| 285 | Target struct { |
| 286 | Host struct { |
| 287 | Compile_multilib *string |
| 288 | } |
| 289 | } |
| 290 | } |
| 291 | p := &props{} |
| 292 | p.Target.Host.Compile_multilib = proptools.StringPtr("first") |
| 293 | ctx.AppendProperties(p) |
| 294 | } |