diff options
Diffstat (limited to 'sysprop/sysprop_test.go')
-rw-r--r-- | sysprop/sysprop_test.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go index 7b906731f..c7f840158 100644 --- a/sysprop/sysprop_test.go +++ b/sysprop/sysprop_test.go @@ -24,6 +24,7 @@ import ( "strings" "testing" + "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -77,7 +78,8 @@ func testContext(config android.Config, bp string, ctx.BottomUp("vndk", cc.VndkMutator).Parallel() ctx.BottomUp("version", cc.VersionMutator).Parallel() ctx.BottomUp("begin", cc.BeginMutator).Parallel() - ctx.BottomUp("sysprop", cc.SyspropMutator).Parallel() + ctx.BottomUp("sysprop_cc", cc.SyspropMutator).Parallel() + ctx.BottomUp("sysprop_java", java.SyspropMutator).Parallel() }) ctx.RegisterModuleType("sysprop_library", syspropLibraryFactory) @@ -210,6 +212,13 @@ func TestSyspropLibrary(t *testing.T) { } java_library { + name: "java-platform-private", + srcs: ["c.java"], + platform_apis: true, + libs: ["sysprop-platform"], + } + + java_library { name: "java-product", srcs: ["c.java"], sdk_version: "system_current", @@ -307,6 +316,7 @@ func TestSyspropLibrary(t *testing.T) { } ctx.ModuleForTests("sysprop-platform", "android_common") + ctx.ModuleForTests("sysprop-platform_public", "android_common") ctx.ModuleForTests("sysprop-vendor", "android_common") // Check for exported includes @@ -359,4 +369,17 @@ func TestSyspropLibrary(t *testing.T) { t.Errorf("flags for vendor must contain %#v and %#v, but was %#v.", platformPublicVendorPath, vendorInternalPath, vendorFlags) } + + // Java modules linking against system API should use public stub + javaSystemApiClient := ctx.ModuleForTests("java-platform", "android_common") + publicStubFound := false + ctx.VisitDirectDeps(javaSystemApiClient.Module(), func(dep blueprint.Module) { + if dep.Name() == "sysprop-platform_public" { + publicStubFound = true + } + }) + if !publicStubFound { + t.Errorf("system api client should use public stub") + } + } |