diff options
author | 2025-02-12 22:16:51 -0800 | |
---|---|---|
committer | 2025-02-12 22:16:51 -0800 | |
commit | 8ea2abcb0ff0f2e23391dbde621d62c0980138e7 (patch) | |
tree | 4d421d8fcaea1914cf782421676fbb0da48af277 /java/androidmk_test.go | |
parent | 421ced81177c558d9b03c958cc78493874e27a25 (diff) | |
parent | 4a80748e09ff307c3052fbb36ac38880fd5d2340 (diff) |
Merge "Don't panic in ModuleForTests and friends" into main am: 4a80748e09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3490133
Change-Id: I2057f531f5d40d61410ce97547d04b6840c4e800
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'java/androidmk_test.go')
-rw-r--r-- | java/androidmk_test.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/java/androidmk_test.go b/java/androidmk_test.go index 9306e72a3..b4b13b11a 100644 --- a/java/androidmk_test.go +++ b/java/androidmk_test.go @@ -32,7 +32,7 @@ func TestRequired(t *testing.T) { } `) - mod := ctx.ModuleForTests("foo", "android_common").Module() + mod := ctx.ModuleForTests(t, "foo", "android_common").Module() entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0] expected := []string{"libfoo"} @@ -52,7 +52,7 @@ func TestHostdex(t *testing.T) { } `) - mod := ctx.ModuleForTests("foo", "android_common").Module() + mod := ctx.ModuleForTests(t, "foo", "android_common").Module() entriesList := android.AndroidMkEntriesForTest(t, ctx, mod) if len(entriesList) != 2 { t.Errorf("two entries are expected, but got %d", len(entriesList)) @@ -84,7 +84,7 @@ func TestHostdexRequired(t *testing.T) { } `) - mod := ctx.ModuleForTests("foo", "android_common").Module() + mod := ctx.ModuleForTests(t, "foo", "android_common").Module() entriesList := android.AndroidMkEntriesForTest(t, ctx, mod) if len(entriesList) != 2 { t.Errorf("two entries are expected, but got %d", len(entriesList)) @@ -120,7 +120,7 @@ func TestHostdexSpecificRequired(t *testing.T) { } `) - mod := ctx.ModuleForTests("foo", "android_common").Module() + mod := ctx.ModuleForTests(t, "foo", "android_common").Module() entriesList := android.AndroidMkEntriesForTest(t, ctx, mod) if len(entriesList) != 2 { t.Errorf("two entries are expected, but got %d", len(entriesList)) @@ -158,7 +158,7 @@ func TestJavaSdkLibrary_RequireXmlPermissionFile(t *testing.T) { `) // Verify the existence of internal modules - result.ModuleForTests("foo-shared_library.xml", "android_common") + result.ModuleForTests(t, "foo-shared_library.xml", "android_common") testCases := []struct { moduleName string @@ -168,7 +168,7 @@ func TestJavaSdkLibrary_RequireXmlPermissionFile(t *testing.T) { {"foo-no_shared_library", []string{"foo-no_shared_library.impl"}}, } for _, tc := range testCases { - mod := result.ModuleForTests(tc.moduleName, "android_common").Module() + mod := result.ModuleForTests(t, tc.moduleName, "android_common").Module() entries := android.AndroidMkEntriesForTest(t, result.TestContext, mod)[0] actual := entries.EntryMap["LOCAL_REQUIRED_MODULES"] if !reflect.DeepEqual(tc.expected, actual) { @@ -205,7 +205,7 @@ func TestAndroidTestHelperApp_LocalDisableTestConfig(t *testing.T) { } `) - mod := ctx.ModuleForTests("foo", "android_common").Module() + mod := ctx.ModuleForTests(t, "foo", "android_common").Module() entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0] expected := []string{"true"} @@ -254,7 +254,7 @@ func TestGetOverriddenPackages(t *testing.T) { } for _, expected := range expectedVariants { - mod := ctx.ModuleForTests(expected.name, expected.variantName).Module() + mod := ctx.ModuleForTests(t, expected.name, expected.variantName).Module() entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0] actual := entries.EntryMap["LOCAL_OVERRIDES_PACKAGES"] @@ -304,7 +304,7 @@ func TestJniAsRequiredDeps(t *testing.T) { } for _, tc := range testcases { - mod := ctx.ModuleForTests(tc.name, "android_common").Module() + mod := ctx.ModuleForTests(t, tc.name, "android_common").Module() entries := android.AndroidMkEntriesForTest(t, ctx.TestContext, mod)[0] required := entries.EntryMap["LOCAL_REQUIRED_MODULES"] android.AssertDeepEquals(t, "unexpected required deps", tc.expected, required) |