Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 1 | // Copyright 2018 Google Inc. All rights reserved. |
| 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 | |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 15 | package etc |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 16 | |
| 17 | import ( |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 18 | "os" |
Patrice Arruda | 300cef9 | 2019-02-22 15:47:57 -0800 | [diff] [blame] | 19 | "path/filepath" |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 20 | "testing" |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 21 | |
| 22 | "android/soong/android" |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 23 | ) |
| 24 | |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 25 | func TestMain(m *testing.M) { |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 26 | os.Exit(m.Run()) |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 27 | } |
| 28 | |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 29 | var prepareForPrebuiltEtcTest = android.GroupFixturePreparers( |
Paul Duffin | 1172fed | 2021-03-08 11:28:18 +0000 | [diff] [blame] | 30 | android.PrepareForTestWithArchMutator, |
| 31 | PrepareForTestWithPrebuiltEtc, |
| 32 | android.FixtureMergeMockFs(android.MockFS{ |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 33 | "foo.conf": nil, |
| 34 | "bar.conf": nil, |
| 35 | "baz.conf": nil, |
Paul Duffin | 1172fed | 2021-03-08 11:28:18 +0000 | [diff] [blame] | 36 | }), |
| 37 | ) |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 38 | |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 39 | func TestPrebuiltEtcVariants(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 40 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 41 | prebuilt_etc { |
| 42 | name: "foo.conf", |
| 43 | src: "foo.conf", |
| 44 | } |
| 45 | prebuilt_etc { |
| 46 | name: "bar.conf", |
| 47 | src: "bar.conf", |
| 48 | recovery_available: true, |
| 49 | } |
| 50 | prebuilt_etc { |
| 51 | name: "baz.conf", |
| 52 | src: "baz.conf", |
| 53 | recovery: true, |
| 54 | } |
| 55 | `) |
| 56 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 57 | foo_variants := result.ModuleVariantsForTests("foo.conf") |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 58 | if len(foo_variants) != 1 { |
| 59 | t.Errorf("expected 1, got %#v", foo_variants) |
| 60 | } |
| 61 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 62 | bar_variants := result.ModuleVariantsForTests("bar.conf") |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 63 | if len(bar_variants) != 2 { |
| 64 | t.Errorf("expected 2, got %#v", bar_variants) |
| 65 | } |
| 66 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 67 | baz_variants := result.ModuleVariantsForTests("baz.conf") |
Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 68 | if len(baz_variants) != 1 { |
| 69 | t.Errorf("expected 1, got %#v", bar_variants) |
| 70 | } |
| 71 | } |
Jiyong Park | 139a2e6 | 2018-10-26 21:49:39 +0900 | [diff] [blame] | 72 | |
| 73 | func TestPrebuiltEtcOutputPath(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 74 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Jiyong Park | 139a2e6 | 2018-10-26 21:49:39 +0900 | [diff] [blame] | 75 | prebuilt_etc { |
| 76 | name: "foo.conf", |
| 77 | src: "foo.conf", |
| 78 | filename: "foo.installed.conf", |
| 79 | } |
| 80 | `) |
| 81 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 82 | p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | e84b133 | 2021-03-12 11:59:43 +0000 | [diff] [blame] | 83 | android.AssertStringEquals(t, "output file path", "foo.installed.conf", p.outputFilePath.Base()) |
Jiyong Park | 139a2e6 | 2018-10-26 21:49:39 +0900 | [diff] [blame] | 84 | } |
Jiyong Park | 1a7cf08 | 2018-11-13 11:59:12 +0900 | [diff] [blame] | 85 | |
| 86 | func TestPrebuiltEtcGlob(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 87 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Jiyong Park | 1a7cf08 | 2018-11-13 11:59:12 +0900 | [diff] [blame] | 88 | prebuilt_etc { |
| 89 | name: "my_foo", |
| 90 | src: "foo.*", |
| 91 | } |
| 92 | prebuilt_etc { |
| 93 | name: "my_bar", |
| 94 | src: "bar.*", |
| 95 | filename_from_src: true, |
| 96 | } |
| 97 | `) |
| 98 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 99 | p := result.Module("my_foo", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | e84b133 | 2021-03-12 11:59:43 +0000 | [diff] [blame] | 100 | android.AssertStringEquals(t, "my_foo output file path", "my_foo", p.outputFilePath.Base()) |
Jiyong Park | 1a7cf08 | 2018-11-13 11:59:12 +0900 | [diff] [blame] | 101 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 102 | p = result.Module("my_bar", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | e84b133 | 2021-03-12 11:59:43 +0000 | [diff] [blame] | 103 | android.AssertStringEquals(t, "my_bar output file path", "bar.conf", p.outputFilePath.Base()) |
Jiyong Park | 1a7cf08 | 2018-11-13 11:59:12 +0900 | [diff] [blame] | 104 | } |
Anton Hansson | ce0e258 | 2019-02-04 14:19:27 +0000 | [diff] [blame] | 105 | |
| 106 | func TestPrebuiltEtcAndroidMk(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 107 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Anton Hansson | ce0e258 | 2019-02-04 14:19:27 +0000 | [diff] [blame] | 108 | prebuilt_etc { |
| 109 | name: "foo", |
| 110 | src: "foo.conf", |
| 111 | owner: "abc", |
| 112 | filename_from_src: true, |
Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 113 | required: ["modA", "moduleB"], |
| 114 | host_required: ["hostModA", "hostModB"], |
| 115 | target_required: ["targetModA"], |
Anton Hansson | ce0e258 | 2019-02-04 14:19:27 +0000 | [diff] [blame] | 116 | } |
| 117 | `) |
| 118 | |
Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 119 | expected := map[string][]string{ |
| 120 | "LOCAL_MODULE": {"foo"}, |
| 121 | "LOCAL_MODULE_CLASS": {"ETC"}, |
| 122 | "LOCAL_MODULE_OWNER": {"abc"}, |
| 123 | "LOCAL_INSTALLED_MODULE_STEM": {"foo.conf"}, |
| 124 | "LOCAL_REQUIRED_MODULES": {"modA", "moduleB"}, |
| 125 | "LOCAL_HOST_REQUIRED_MODULES": {"hostModA", "hostModB"}, |
| 126 | "LOCAL_TARGET_REQUIRED_MODULES": {"targetModA"}, |
Anton Hansson | ce0e258 | 2019-02-04 14:19:27 +0000 | [diff] [blame] | 127 | } |
| 128 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 129 | mod := result.Module("foo", "android_arm64_armv8-a").(*PrebuiltEtc) |
| 130 | entries := android.AndroidMkEntriesForTest(t, result.TestContext, mod)[0] |
Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 131 | for k, expectedValue := range expected { |
| 132 | if value, ok := entries.EntryMap[k]; ok { |
Paul Duffin | e84b133 | 2021-03-12 11:59:43 +0000 | [diff] [blame] | 133 | android.AssertDeepEquals(t, k, expectedValue, value) |
Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 134 | } else { |
| 135 | t.Errorf("No %s defined, saw %q", k, entries.EntryMap) |
Anton Hansson | ce0e258 | 2019-02-04 14:19:27 +0000 | [diff] [blame] | 136 | } |
| 137 | } |
| 138 | } |
Jaewoong Jung | 2478818 | 2019-02-04 14:34:10 -0800 | [diff] [blame] | 139 | |
Liz Kammer | 0449a63 | 2020-06-26 10:12:36 -0700 | [diff] [blame] | 140 | func TestPrebuiltEtcRelativeInstallPathInstallDirPath(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 141 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Liz Kammer | 0449a63 | 2020-06-26 10:12:36 -0700 | [diff] [blame] | 142 | prebuilt_etc { |
| 143 | name: "foo.conf", |
| 144 | src: "foo.conf", |
| 145 | relative_install_path: "bar", |
| 146 | } |
| 147 | `) |
| 148 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 149 | p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 150 | expected := "out/soong/target/product/test_device/system/etc/bar" |
| 151 | android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) |
Liz Kammer | 0449a63 | 2020-06-26 10:12:36 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | func TestPrebuiltEtcCannotSetRelativeInstallPathAndSubDir(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 155 | prepareForPrebuiltEtcTest. |
Paul Duffin | 1172fed | 2021-03-08 11:28:18 +0000 | [diff] [blame] | 156 | ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern("relative_install_path is set. Cannot set sub_dir")). |
| 157 | RunTestWithBp(t, ` |
| 158 | prebuilt_etc { |
| 159 | name: "foo.conf", |
| 160 | src: "foo.conf", |
| 161 | sub_dir: "bar", |
| 162 | relative_install_path: "bar", |
| 163 | } |
| 164 | `) |
Liz Kammer | 0449a63 | 2020-06-26 10:12:36 -0700 | [diff] [blame] | 165 | } |
| 166 | |
Jaewoong Jung | 2478818 | 2019-02-04 14:34:10 -0800 | [diff] [blame] | 167 | func TestPrebuiltEtcHost(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 168 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Jaewoong Jung | 2478818 | 2019-02-04 14:34:10 -0800 | [diff] [blame] | 169 | prebuilt_etc_host { |
| 170 | name: "foo.conf", |
| 171 | src: "foo.conf", |
| 172 | } |
| 173 | `) |
| 174 | |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 175 | buildOS := android.BuildOs.String() |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 176 | p := result.Module("foo.conf", buildOS+"_common").(*PrebuiltEtc) |
Jaewoong Jung | 2478818 | 2019-02-04 14:34:10 -0800 | [diff] [blame] | 177 | if !p.Host() { |
| 178 | t.Errorf("host bit is not set for a prebuilt_etc_host module.") |
| 179 | } |
| 180 | } |
Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 181 | |
Inseob Kim | 27408bf | 2021-04-06 21:00:17 +0900 | [diff] [blame^] | 182 | func TestPrebuiltRootInstallDirPath(t *testing.T) { |
| 183 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
| 184 | prebuilt_root { |
| 185 | name: "foo.conf", |
| 186 | src: "foo.conf", |
| 187 | filename: "foo.conf", |
| 188 | } |
| 189 | `) |
| 190 | |
| 191 | p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) |
| 192 | expected := "out/soong/target/product/test_device/system" |
| 193 | android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) |
| 194 | } |
| 195 | |
| 196 | func TestPrebuiltRootInstallDirPathValidate(t *testing.T) { |
| 197 | prepareForPrebuiltEtcTest.ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern("filename cannot contain separator")).RunTestWithBp(t, ` |
| 198 | prebuilt_root { |
| 199 | name: "foo.conf", |
| 200 | src: "foo.conf", |
| 201 | filename: "foo/bar.conf", |
| 202 | } |
| 203 | `) |
| 204 | } |
| 205 | |
Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 206 | func TestPrebuiltUserShareInstallDirPath(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 207 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 208 | prebuilt_usr_share { |
| 209 | name: "foo.conf", |
| 210 | src: "foo.conf", |
| 211 | sub_dir: "bar", |
| 212 | } |
| 213 | `) |
| 214 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 215 | p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 216 | expected := "out/soong/target/product/test_device/system/usr/share/bar" |
| 217 | android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) |
Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 218 | } |
Patrice Arruda | 300cef9 | 2019-02-22 15:47:57 -0800 | [diff] [blame] | 219 | |
| 220 | func TestPrebuiltUserShareHostInstallDirPath(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 221 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Patrice Arruda | 300cef9 | 2019-02-22 15:47:57 -0800 | [diff] [blame] | 222 | prebuilt_usr_share_host { |
| 223 | name: "foo.conf", |
| 224 | src: "foo.conf", |
| 225 | sub_dir: "bar", |
| 226 | } |
| 227 | `) |
| 228 | |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 229 | buildOS := android.BuildOs.String() |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 230 | p := result.Module("foo.conf", buildOS+"_common").(*PrebuiltEtc) |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 231 | expected := filepath.Join("out/soong/host", result.Config.PrebuiltOS(), "usr", "share", "bar") |
| 232 | android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) |
Patrice Arruda | 300cef9 | 2019-02-22 15:47:57 -0800 | [diff] [blame] | 233 | } |
Patrice Arruda | 61583eb | 2019-05-14 08:20:45 -0700 | [diff] [blame] | 234 | |
| 235 | func TestPrebuiltFontInstallDirPath(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 236 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` |
Patrice Arruda | 61583eb | 2019-05-14 08:20:45 -0700 | [diff] [blame] | 237 | prebuilt_font { |
| 238 | name: "foo.conf", |
| 239 | src: "foo.conf", |
| 240 | } |
| 241 | `) |
| 242 | |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 243 | p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 244 | expected := "out/soong/target/product/test_device/system/fonts" |
| 245 | android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) |
Patrice Arruda | 61583eb | 2019-05-14 08:20:45 -0700 | [diff] [blame] | 246 | } |
Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 247 | |
| 248 | func TestPrebuiltFirmwareDirPath(t *testing.T) { |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 249 | targetPath := "out/soong/target/product/test_device" |
Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 250 | tests := []struct { |
| 251 | description string |
| 252 | config string |
| 253 | expectedPath string |
| 254 | }{{ |
| 255 | description: "prebuilt: system firmware", |
| 256 | config: ` |
| 257 | prebuilt_firmware { |
| 258 | name: "foo.conf", |
| 259 | src: "foo.conf", |
| 260 | }`, |
| 261 | expectedPath: filepath.Join(targetPath, "system/etc/firmware"), |
| 262 | }, { |
| 263 | description: "prebuilt: vendor firmware", |
| 264 | config: ` |
| 265 | prebuilt_firmware { |
| 266 | name: "foo.conf", |
| 267 | src: "foo.conf", |
| 268 | soc_specific: true, |
| 269 | sub_dir: "sub_dir", |
| 270 | }`, |
| 271 | expectedPath: filepath.Join(targetPath, "vendor/firmware/sub_dir"), |
| 272 | }} |
| 273 | for _, tt := range tests { |
| 274 | t.Run(tt.description, func(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 275 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, tt.config) |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 276 | p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 277 | android.AssertPathRelativeToTopEquals(t, "install dir", tt.expectedPath, p.installDirPath) |
Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 278 | }) |
| 279 | } |
| 280 | } |
Patrice Arruda | 0f68800 | 2020-06-08 21:40:25 +0000 | [diff] [blame] | 281 | |
| 282 | func TestPrebuiltDSPDirPath(t *testing.T) { |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 283 | targetPath := "out/soong/target/product/test_device" |
Patrice Arruda | 0f68800 | 2020-06-08 21:40:25 +0000 | [diff] [blame] | 284 | tests := []struct { |
| 285 | description string |
| 286 | config string |
| 287 | expectedPath string |
| 288 | }{{ |
| 289 | description: "prebuilt: system dsp", |
| 290 | config: ` |
| 291 | prebuilt_dsp { |
| 292 | name: "foo.conf", |
| 293 | src: "foo.conf", |
| 294 | }`, |
| 295 | expectedPath: filepath.Join(targetPath, "system/etc/dsp"), |
| 296 | }, { |
| 297 | description: "prebuilt: vendor dsp", |
| 298 | config: ` |
| 299 | prebuilt_dsp { |
| 300 | name: "foo.conf", |
| 301 | src: "foo.conf", |
| 302 | soc_specific: true, |
| 303 | sub_dir: "sub_dir", |
| 304 | }`, |
| 305 | expectedPath: filepath.Join(targetPath, "vendor/dsp/sub_dir"), |
| 306 | }} |
| 307 | for _, tt := range tests { |
| 308 | t.Run(tt.description, func(t *testing.T) { |
Paul Duffin | 89648f9 | 2021-03-20 00:36:55 +0000 | [diff] [blame] | 309 | result := prepareForPrebuiltEtcTest.RunTestWithBp(t, tt.config) |
Paul Duffin | 921fac7 | 2021-03-10 09:00:58 +0000 | [diff] [blame] | 310 | p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) |
Paul Duffin | 5f9f771 | 2021-03-15 15:35:49 +0000 | [diff] [blame] | 311 | android.AssertPathRelativeToTopEquals(t, "install dir", tt.expectedPath, p.installDirPath) |
Patrice Arruda | 0f68800 | 2020-06-08 21:40:25 +0000 | [diff] [blame] | 312 | }) |
| 313 | } |
| 314 | } |