summaryrefslogtreecommitdiff
path: root/java/jdeps_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-02-12 21:54:11 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-02-12 21:54:11 -0800
commit4a80748e09ff307c3052fbb36ac38880fd5d2340 (patch)
tree4d421d8fcaea1914cf782421676fbb0da48af277 /java/jdeps_test.go
parentc0a00df42e8f63caa3070c80a1e40db22bc574cc (diff)
parent90607e9056f6ff4cec2447fdd7a8b252d67ffde7 (diff)
Merge "Don't panic in ModuleForTests and friends" into main
Diffstat (limited to 'java/jdeps_test.go')
-rw-r--r--java/jdeps_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/java/jdeps_test.go b/java/jdeps_test.go
index 2cbf75bc7..00f383997 100644
--- a/java/jdeps_test.go
+++ b/java/jdeps_test.go
@@ -32,7 +32,7 @@ func TestCollectJavaLibraryPropertiesAddLibsDeps(t *testing.T) {
libs: ["Foo", "Bar"],
}
`)
- module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
+ module := ctx.ModuleForTests(t, "javalib", "android_common").Module().(*Library)
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
for _, expected := range []string{"Foo", "Bar"} {
@@ -53,7 +53,7 @@ func TestCollectJavaLibraryPropertiesAddStaticLibsDeps(t *testing.T) {
static_libs: ["Foo", "Bar"],
}
`)
- module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
+ module := ctx.ModuleForTests(t, "javalib", "android_common").Module().(*Library)
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
for _, expected := range []string{"Foo", "Bar"} {
@@ -72,7 +72,7 @@ func TestCollectJavaLibraryPropertiesAddScrs(t *testing.T) {
srcs: ["Foo.java", "Bar.java"],
}
`)
- module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
+ module := ctx.ModuleForTests(t, "javalib", "android_common").Module().(*Library)
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
expected := []string{"Foo.java", "Bar.java"}
@@ -92,7 +92,7 @@ func TestCollectJavaLibraryPropertiesAddAidlIncludeDirs(t *testing.T) {
},
}
`)
- module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
+ module := ctx.ModuleForTests(t, "javalib", "android_common").Module().(*Library)
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
expected := []string{"Foo", "Bar"}
@@ -111,7 +111,7 @@ func TestCollectJavaLibraryWithJarJarRules(t *testing.T) {
jarjar_rules: "jarjar_rules.txt",
}
`)
- module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
+ module := ctx.ModuleForTests(t, "javalib", "android_common").Module().(*Library)
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
android.AssertStringEquals(t, "IdeInfo.Srcs of repackaged library should not be empty", "foo.java", dpInfo.Srcs[0])
@@ -135,7 +135,7 @@ func TestCollectJavaLibraryLinkingAgainstVersionedSdk(t *testing.T) {
sdk_version: "29",
}
`)
- module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
+ module := ctx.ModuleForTests(t, "javalib", "android_common").Module().(*Library)
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
android.AssertStringListContains(t, "IdeInfo.Deps should contain versioned sdk module", dpInfo.Deps, "sdk_public_29_android")
@@ -171,11 +171,11 @@ func TestDoNotAddNoneSystemModulesToDeps(t *testing.T) {
api_surface: "public",
}
`)
- javalib := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
+ javalib := ctx.ModuleForTests(t, "javalib", "android_common").Module().(*Library)
dpInfo, _ := android.OtherModuleProvider(ctx, javalib, android.IdeInfoProviderKey)
android.AssertStringListDoesNotContain(t, "IdeInfo.Deps should contain not contain `none`", dpInfo.Deps, "none")
- javalib_stubs := ctx.ModuleForTests("javalib.stubs", "android_common").Module().(*ApiLibrary)
+ javalib_stubs := ctx.ModuleForTests(t, "javalib.stubs", "android_common").Module().(*ApiLibrary)
dpInfo, _ = android.OtherModuleProvider(ctx, javalib_stubs, android.IdeInfoProviderKey)
android.AssertStringListDoesNotContain(t, "IdeInfo.Deps should contain not contain `none`", dpInfo.Deps, "none")
}