diff options
| author | 2020-07-09 21:42:34 +0000 | |
|---|---|---|
| committer | 2020-07-09 21:42:34 +0000 | |
| commit | e371a18acc20ca53b55bf9784c28608d7ea8bdac (patch) | |
| tree | a426527fda0c17f2fb52ae212f805ca8fae40857 /java/java_test.go | |
| parent | 3757864b5ffdab4c14e619f5b583b969ffd256da (diff) | |
| parent | cee7e66b07cdea5d37fbdd94bb1a34cc8caa448f (diff) | |
Ensure that sdk/module_exports depends on source members am: cee7e66b07
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359444
Change-Id: Ie52a110e30e646a0fdf9479039bb58ee6a722078
Diffstat (limited to 'java/java_test.go')
| -rw-r--r-- | java/java_test.go | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/java/java_test.go b/java/java_test.go index 59a2ce7aa..fb003619f 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -25,7 +25,6 @@ import ( "strings" "testing" - "github.com/google/blueprint" "github.com/google/blueprint/proptools" "android/soong/android" @@ -173,20 +172,6 @@ func moduleToPath(name string) string { } } -func checkModuleDependencies(t *testing.T, ctx *android.TestContext, name, variant string, expected []string) { - t.Helper() - module := ctx.ModuleForTests(name, variant).Module() - deps := []string{} - ctx.VisitDirectDeps(module, func(m blueprint.Module) { - deps = append(deps, m.Name()) - }) - sort.Strings(deps) - - if actual := deps; !reflect.DeepEqual(expected, actual) { - t.Errorf("expected %#q, found %#q", expected, actual) - } -} - func TestJavaLinkType(t *testing.T) { testJava(t, ` java_library { @@ -647,7 +632,7 @@ func TestJavaSdkLibraryImport(t *testing.T) { } } - checkModuleDependencies(t, ctx, "sdklib", "android_common", []string{ + CheckModuleDependencies(t, ctx, "sdklib", "android_common", []string{ `prebuilt_sdklib.stubs`, `prebuilt_sdklib.stubs.source.test`, `prebuilt_sdklib.stubs.system`, @@ -675,7 +660,7 @@ func TestJavaSdkLibraryImport_WithSource(t *testing.T) { } `) - checkModuleDependencies(t, ctx, "sdklib", "android_common", []string{ + CheckModuleDependencies(t, ctx, "sdklib", "android_common", []string{ `dex2oatd`, `prebuilt_sdklib`, `sdklib.impl`, @@ -684,7 +669,7 @@ func TestJavaSdkLibraryImport_WithSource(t *testing.T) { `sdklib.xml`, }) - checkModuleDependencies(t, ctx, "prebuilt_sdklib", "android_common", []string{ + CheckModuleDependencies(t, ctx, "prebuilt_sdklib", "android_common", []string{ `prebuilt_sdklib.stubs`, `sdklib.impl`, // This should be prebuilt_sdklib.stubs but is set to sdklib.stubs because the @@ -715,7 +700,7 @@ func TestJavaSdkLibraryImport_Preferred(t *testing.T) { } `) - checkModuleDependencies(t, ctx, "sdklib", "android_common", []string{ + CheckModuleDependencies(t, ctx, "sdklib", "android_common", []string{ `dex2oatd`, `prebuilt_sdklib`, `sdklib.impl`, @@ -724,7 +709,7 @@ func TestJavaSdkLibraryImport_Preferred(t *testing.T) { `sdklib.xml`, }) - checkModuleDependencies(t, ctx, "prebuilt_sdklib", "android_common", []string{ + CheckModuleDependencies(t, ctx, "prebuilt_sdklib", "android_common", []string{ `prebuilt_sdklib.stubs`, `sdklib.impl`, `sdklib.xml`, @@ -1491,7 +1476,7 @@ func TestJavaSdkLibrary_Deps(t *testing.T) { } `) - checkModuleDependencies(t, ctx, "sdklib", "android_common", []string{ + CheckModuleDependencies(t, ctx, "sdklib", "android_common", []string{ `dex2oatd`, `sdklib.impl`, `sdklib.stubs`, |