Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 1 | // Copyright (C) 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 sysprop |
| 16 | |
| 17 | import ( |
| 18 | "android/soong/android" |
| 19 | "android/soong/cc" |
| 20 | "android/soong/java" |
| 21 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 22 | "io/ioutil" |
| 23 | "os" |
| 24 | "strings" |
| 25 | "testing" |
| 26 | |
Inseob Kim | ac1e986 | 2019-12-09 18:15:47 +0900 | [diff] [blame] | 27 | "github.com/google/blueprint" |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 28 | "github.com/google/blueprint/proptools" |
| 29 | ) |
| 30 | |
| 31 | var buildDir string |
| 32 | |
| 33 | func setUp() { |
| 34 | var err error |
| 35 | buildDir, err = ioutil.TempDir("", "soong_sysprop_test") |
| 36 | if err != nil { |
| 37 | panic(err) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func tearDown() { |
| 42 | os.RemoveAll(buildDir) |
| 43 | } |
| 44 | |
| 45 | func TestMain(m *testing.M) { |
| 46 | run := func() int { |
| 47 | setUp() |
| 48 | defer tearDown() |
| 49 | |
| 50 | return m.Run() |
| 51 | } |
| 52 | |
| 53 | os.Exit(run()) |
| 54 | } |
| 55 | |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 56 | func testContext(config android.Config) *android.TestContext { |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 57 | |
| 58 | ctx := android.NewTestArchContext() |
Paul Duffin | f9b1da0 | 2019-12-18 19:51:55 +0000 | [diff] [blame] | 59 | java.RegisterJavaBuildComponents(ctx) |
| 60 | java.RegisterAppBuildComponents(ctx) |
Paul Duffin | 43dc1cc | 2019-12-19 11:18:54 +0000 | [diff] [blame] | 61 | java.RegisterSystemModulesBuildComponents(ctx) |
| 62 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 63 | ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators) |
Inseob Kim | 988f53c | 2019-09-16 15:59:01 +0900 | [diff] [blame] | 64 | ctx.PreArchMutators(func(ctx android.RegisterMutatorsContext) { |
| 65 | ctx.BottomUp("sysprop_deps", syspropDepsMutator).Parallel() |
| 66 | }) |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 67 | |
Paul Duffin | 77980a8 | 2019-12-19 16:01:36 +0000 | [diff] [blame] | 68 | cc.RegisterRequiredBuildComponentsForTest(ctx) |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 69 | ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { |
Inseob Kim | ac1e986 | 2019-12-09 18:15:47 +0900 | [diff] [blame] | 70 | ctx.BottomUp("sysprop_java", java.SyspropMutator).Parallel() |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 71 | }) |
| 72 | |
Colin Cross | 4b49b76 | 2019-11-22 15:25:03 -0800 | [diff] [blame] | 73 | ctx.RegisterModuleType("sysprop_library", syspropLibraryFactory) |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 74 | |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 75 | ctx.Register(config) |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 76 | |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 77 | return ctx |
| 78 | } |
| 79 | |
| 80 | func run(t *testing.T, ctx *android.TestContext, config android.Config) { |
| 81 | t.Helper() |
| 82 | _, errs := ctx.ParseFileList(".", []string{"Android.bp"}) |
| 83 | android.FailIfErrored(t, errs) |
| 84 | _, errs = ctx.PrepareBuildActions(config) |
| 85 | android.FailIfErrored(t, errs) |
| 86 | } |
| 87 | |
| 88 | func testConfig(env map[string]string, bp string, fs map[string][]byte) android.Config { |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 89 | bp += cc.GatherRequiredDepsForTest(android.Android) |
| 90 | |
| 91 | mockFS := map[string][]byte{ |
Inseob Kim | 4288274 | 2019-07-30 17:55:33 +0900 | [diff] [blame] | 92 | "a.java": nil, |
| 93 | "b.java": nil, |
| 94 | "c.java": nil, |
| 95 | "d.cpp": nil, |
| 96 | "api/sysprop-platform-current.txt": nil, |
| 97 | "api/sysprop-platform-latest.txt": nil, |
| 98 | "api/sysprop-platform-on-product-current.txt": nil, |
| 99 | "api/sysprop-platform-on-product-latest.txt": nil, |
| 100 | "api/sysprop-vendor-current.txt": nil, |
| 101 | "api/sysprop-vendor-latest.txt": nil, |
| 102 | "api/sysprop-odm-current.txt": nil, |
| 103 | "api/sysprop-odm-latest.txt": nil, |
| 104 | "framework/aidl/a.aidl": nil, |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 105 | |
| 106 | // For framework-res, which is an implicit dependency for framework |
Dan Willemsen | 412160e | 2019-04-09 21:36:26 -0700 | [diff] [blame] | 107 | "AndroidManifest.xml": nil, |
| 108 | "build/make/target/product/security/testkey": nil, |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 109 | |
| 110 | "build/soong/scripts/jar-wrapper.sh": nil, |
| 111 | |
| 112 | "build/make/core/proguard.flags": nil, |
| 113 | "build/make/core/proguard_basic_keeps.flags": nil, |
| 114 | |
| 115 | "jdk8/jre/lib/jce.jar": nil, |
| 116 | "jdk8/jre/lib/rt.jar": nil, |
| 117 | "jdk8/lib/tools.jar": nil, |
| 118 | |
| 119 | "bar-doc/a.java": nil, |
| 120 | "bar-doc/b.java": nil, |
| 121 | "bar-doc/IFoo.aidl": nil, |
| 122 | "bar-doc/known_oj_tags.txt": nil, |
| 123 | "external/doclava/templates-sdk": nil, |
| 124 | |
| 125 | "cert/new_cert.x509.pem": nil, |
| 126 | "cert/new_cert.pk8": nil, |
| 127 | |
| 128 | "android/sysprop/PlatformProperties.sysprop": nil, |
| 129 | "com/android/VendorProperties.sysprop": nil, |
Inseob Kim | 4288274 | 2019-07-30 17:55:33 +0900 | [diff] [blame] | 130 | "com/android2/OdmProperties.sysprop": nil, |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | for k, v := range fs { |
| 134 | mockFS[k] = v |
| 135 | } |
| 136 | |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 137 | config := java.TestConfig(buildDir, env, bp, mockFS) |
Colin Cross | e4759b9 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 138 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 139 | config.TestProductVariables.DeviceSystemSdkVersions = []string{"28"} |
| 140 | config.TestProductVariables.DeviceVndkVersion = proptools.StringPtr("current") |
| 141 | config.TestProductVariables.Platform_vndk_version = proptools.StringPtr("VER") |
Colin Cross | e4759b9 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 142 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 143 | return config |
| 144 | |
| 145 | } |
| 146 | |
| 147 | func test(t *testing.T, bp string) *android.TestContext { |
| 148 | t.Helper() |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 149 | config := testConfig(nil, bp, nil) |
| 150 | ctx := testContext(config) |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 151 | run(t, ctx, config) |
| 152 | |
| 153 | return ctx |
| 154 | } |
| 155 | |
| 156 | func TestSyspropLibrary(t *testing.T) { |
| 157 | ctx := test(t, ` |
| 158 | sysprop_library { |
| 159 | name: "sysprop-platform", |
| 160 | srcs: ["android/sysprop/PlatformProperties.sysprop"], |
| 161 | api_packages: ["android.sysprop"], |
| 162 | property_owner: "Platform", |
| 163 | vendor_available: true, |
Inseob Kim | 89db15d | 2020-02-03 18:06:46 +0900 | [diff] [blame^] | 164 | host_supported: true, |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | sysprop_library { |
| 168 | name: "sysprop-platform-on-product", |
| 169 | srcs: ["android/sysprop/PlatformProperties.sysprop"], |
| 170 | api_packages: ["android.sysprop"], |
| 171 | property_owner: "Platform", |
| 172 | product_specific: true, |
| 173 | } |
| 174 | |
| 175 | sysprop_library { |
| 176 | name: "sysprop-vendor", |
| 177 | srcs: ["com/android/VendorProperties.sysprop"], |
| 178 | api_packages: ["com.android"], |
| 179 | property_owner: "Vendor", |
| 180 | product_specific: true, |
| 181 | vendor_available: true, |
| 182 | } |
| 183 | |
Inseob Kim | 4288274 | 2019-07-30 17:55:33 +0900 | [diff] [blame] | 184 | sysprop_library { |
| 185 | name: "sysprop-odm", |
| 186 | srcs: ["com/android2/OdmProperties.sysprop"], |
| 187 | api_packages: ["com.android2"], |
| 188 | property_owner: "Odm", |
| 189 | device_specific: true, |
| 190 | } |
| 191 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 192 | java_library { |
| 193 | name: "java-platform", |
| 194 | srcs: ["c.java"], |
| 195 | sdk_version: "system_current", |
| 196 | libs: ["sysprop-platform"], |
| 197 | } |
| 198 | |
| 199 | java_library { |
Inseob Kim | ac1e986 | 2019-12-09 18:15:47 +0900 | [diff] [blame] | 200 | name: "java-platform-private", |
| 201 | srcs: ["c.java"], |
| 202 | platform_apis: true, |
| 203 | libs: ["sysprop-platform"], |
| 204 | } |
| 205 | |
| 206 | java_library { |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 207 | name: "java-product", |
| 208 | srcs: ["c.java"], |
| 209 | sdk_version: "system_current", |
| 210 | product_specific: true, |
| 211 | libs: ["sysprop-platform", "sysprop-vendor"], |
| 212 | } |
| 213 | |
| 214 | java_library { |
| 215 | name: "java-vendor", |
| 216 | srcs: ["c.java"], |
| 217 | sdk_version: "system_current", |
| 218 | soc_specific: true, |
| 219 | libs: ["sysprop-platform", "sysprop-vendor"], |
| 220 | } |
| 221 | |
| 222 | cc_library { |
| 223 | name: "cc-client-platform", |
| 224 | srcs: ["d.cpp"], |
| 225 | static_libs: ["sysprop-platform"], |
| 226 | } |
| 227 | |
Jiyong Park | 5d1598f | 2019-02-25 22:14:17 +0900 | [diff] [blame] | 228 | cc_library_static { |
| 229 | name: "cc-client-platform-static", |
| 230 | srcs: ["d.cpp"], |
| 231 | whole_static_libs: ["sysprop-platform"], |
| 232 | } |
| 233 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 234 | cc_library { |
| 235 | name: "cc-client-product", |
| 236 | srcs: ["d.cpp"], |
| 237 | product_specific: true, |
| 238 | static_libs: ["sysprop-platform-on-product", "sysprop-vendor"], |
| 239 | } |
| 240 | |
| 241 | cc_library { |
| 242 | name: "cc-client-vendor", |
| 243 | srcs: ["d.cpp"], |
| 244 | soc_specific: true, |
| 245 | static_libs: ["sysprop-platform", "sysprop-vendor"], |
| 246 | } |
Inseob Kim | 1f95976 | 2019-03-27 17:20:37 +0900 | [diff] [blame] | 247 | |
Inseob Kim | 89db15d | 2020-02-03 18:06:46 +0900 | [diff] [blame^] | 248 | cc_library { |
| 249 | name: "libbase", |
| 250 | host_supported: true, |
| 251 | } |
| 252 | |
Inseob Kim | 1f95976 | 2019-03-27 17:20:37 +0900 | [diff] [blame] | 253 | cc_library_headers { |
| 254 | name: "libbase_headers", |
| 255 | vendor_available: true, |
| 256 | recovery_available: true, |
| 257 | } |
| 258 | |
| 259 | cc_library { |
| 260 | name: "liblog", |
Yi Kong | e7fe991 | 2019-06-02 00:53:50 -0700 | [diff] [blame] | 261 | no_libcrt: true, |
Inseob Kim | 1f95976 | 2019-03-27 17:20:37 +0900 | [diff] [blame] | 262 | nocrt: true, |
| 263 | system_shared_libs: [], |
| 264 | recovery_available: true, |
Inseob Kim | 89db15d | 2020-02-03 18:06:46 +0900 | [diff] [blame^] | 265 | host_supported: true, |
| 266 | } |
| 267 | |
| 268 | cc_binary_host { |
| 269 | name: "hostbin", |
| 270 | static_libs: ["sysprop-platform"], |
Inseob Kim | 1f95976 | 2019-03-27 17:20:37 +0900 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | llndk_library { |
| 274 | name: "liblog", |
| 275 | symbol_file: "", |
| 276 | } |
Inseob Kim | 4288274 | 2019-07-30 17:55:33 +0900 | [diff] [blame] | 277 | |
| 278 | java_library { |
| 279 | name: "sysprop-library-stub-platform", |
| 280 | sdk_version: "core_current", |
| 281 | } |
| 282 | |
| 283 | java_library { |
| 284 | name: "sysprop-library-stub-vendor", |
| 285 | soc_specific: true, |
| 286 | sdk_version: "core_current", |
| 287 | } |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 288 | `) |
| 289 | |
Inseob Kim | 4288274 | 2019-07-30 17:55:33 +0900 | [diff] [blame] | 290 | // Check for generated cc_library |
| 291 | for _, variant := range []string{ |
Colin Cross | fb0c16e | 2019-11-20 17:12:35 -0800 | [diff] [blame] | 292 | "android_vendor.VER_arm_armv7-a-neon_shared", |
| 293 | "android_vendor.VER_arm_armv7-a-neon_static", |
| 294 | "android_vendor.VER_arm64_armv8-a_shared", |
| 295 | "android_vendor.VER_arm64_armv8-a_static", |
Inseob Kim | 4288274 | 2019-07-30 17:55:33 +0900 | [diff] [blame] | 296 | } { |
| 297 | ctx.ModuleForTests("libsysprop-platform", variant) |
| 298 | ctx.ModuleForTests("libsysprop-vendor", variant) |
| 299 | ctx.ModuleForTests("libsysprop-odm", variant) |
| 300 | } |
| 301 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 302 | for _, variant := range []string{ |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 303 | "android_arm_armv7-a-neon_shared", |
| 304 | "android_arm_armv7-a-neon_static", |
| 305 | "android_arm64_armv8-a_shared", |
| 306 | "android_arm64_armv8-a_static", |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 307 | } { |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 308 | ctx.ModuleForTests("libsysprop-platform", variant) |
Inseob Kim | 4288274 | 2019-07-30 17:55:33 +0900 | [diff] [blame] | 309 | |
| 310 | // core variant of vendor-owned sysprop_library is for product |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 311 | ctx.ModuleForTests("libsysprop-vendor", variant) |
| 312 | } |
| 313 | |
| 314 | ctx.ModuleForTests("sysprop-platform", "android_common") |
Inseob Kim | ac1e986 | 2019-12-09 18:15:47 +0900 | [diff] [blame] | 315 | ctx.ModuleForTests("sysprop-platform_public", "android_common") |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 316 | ctx.ModuleForTests("sysprop-vendor", "android_common") |
| 317 | |
| 318 | // Check for exported includes |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 319 | coreVariant := "android_arm64_armv8-a_static" |
Colin Cross | fb0c16e | 2019-11-20 17:12:35 -0800 | [diff] [blame] | 320 | vendorVariant := "android_vendor.VER_arm64_armv8-a_static" |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 321 | |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 322 | platformInternalPath := "libsysprop-platform/android_arm64_armv8-a_static/gen/sysprop/include" |
| 323 | platformPublicCorePath := "libsysprop-platform/android_arm64_armv8-a_static/gen/sysprop/public/include" |
Colin Cross | fb0c16e | 2019-11-20 17:12:35 -0800 | [diff] [blame] | 324 | platformPublicVendorPath := "libsysprop-platform/android_vendor.VER_arm64_armv8-a_static/gen/sysprop/public/include" |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 325 | |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 326 | platformOnProductPath := "libsysprop-platform-on-product/android_arm64_armv8-a_static/gen/sysprop/public/include" |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 327 | |
Colin Cross | fb0c16e | 2019-11-20 17:12:35 -0800 | [diff] [blame] | 328 | vendorInternalPath := "libsysprop-vendor/android_vendor.VER_arm64_armv8-a_static/gen/sysprop/include" |
Colin Cross | 7113d20 | 2019-11-20 16:39:12 -0800 | [diff] [blame] | 329 | vendorPublicPath := "libsysprop-vendor/android_arm64_armv8-a_static/gen/sysprop/public/include" |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 330 | |
| 331 | platformClient := ctx.ModuleForTests("cc-client-platform", coreVariant) |
| 332 | platformFlags := platformClient.Rule("cc").Args["cFlags"] |
| 333 | |
Jiyong Park | 5d1598f | 2019-02-25 22:14:17 +0900 | [diff] [blame] | 334 | // platform should use platform's internal header |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 335 | if !strings.Contains(platformFlags, platformInternalPath) { |
| 336 | t.Errorf("flags for platform must contain %#v, but was %#v.", |
| 337 | platformInternalPath, platformFlags) |
| 338 | } |
| 339 | |
Jiyong Park | 5d1598f | 2019-02-25 22:14:17 +0900 | [diff] [blame] | 340 | platformStaticClient := ctx.ModuleForTests("cc-client-platform-static", coreVariant) |
| 341 | platformStaticFlags := platformStaticClient.Rule("cc").Args["cFlags"] |
| 342 | |
| 343 | // platform-static should use platform's internal header |
| 344 | if !strings.Contains(platformStaticFlags, platformInternalPath) { |
| 345 | t.Errorf("flags for platform-static must contain %#v, but was %#v.", |
| 346 | platformInternalPath, platformStaticFlags) |
| 347 | } |
| 348 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 349 | productClient := ctx.ModuleForTests("cc-client-product", coreVariant) |
| 350 | productFlags := productClient.Rule("cc").Args["cFlags"] |
| 351 | |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 352 | // Product should use platform's and vendor's public headers |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 353 | if !strings.Contains(productFlags, platformOnProductPath) || |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 354 | !strings.Contains(productFlags, vendorPublicPath) { |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 355 | t.Errorf("flags for product must contain %#v and %#v, but was %#v.", |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 356 | platformPublicCorePath, vendorPublicPath, productFlags) |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 357 | } |
| 358 | |
| 359 | vendorClient := ctx.ModuleForTests("cc-client-vendor", vendorVariant) |
| 360 | vendorFlags := vendorClient.Rule("cc").Args["cFlags"] |
| 361 | |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 362 | // Vendor should use platform's public header and vendor's internal header |
| 363 | if !strings.Contains(vendorFlags, platformPublicVendorPath) || |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 364 | !strings.Contains(vendorFlags, vendorInternalPath) { |
| 365 | t.Errorf("flags for vendor must contain %#v and %#v, but was %#v.", |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 366 | platformPublicVendorPath, vendorInternalPath, vendorFlags) |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 367 | } |
Inseob Kim | ac1e986 | 2019-12-09 18:15:47 +0900 | [diff] [blame] | 368 | |
| 369 | // Java modules linking against system API should use public stub |
| 370 | javaSystemApiClient := ctx.ModuleForTests("java-platform", "android_common") |
| 371 | publicStubFound := false |
| 372 | ctx.VisitDirectDeps(javaSystemApiClient.Module(), func(dep blueprint.Module) { |
| 373 | if dep.Name() == "sysprop-platform_public" { |
| 374 | publicStubFound = true |
| 375 | } |
| 376 | }) |
| 377 | if !publicStubFound { |
| 378 | t.Errorf("system api client should use public stub") |
| 379 | } |
| 380 | |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 381 | } |