summaryrefslogtreecommitdiff
path: root/java/testing.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-02-12 22:42:20 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-02-12 22:42:20 -0800
commita17496cb5d6effeb341f6b95acd5a4d4735642bf (patch)
tree051c99c1fae6383de4b5d2785dbb7a00dd3571c3 /java/testing.go
parent852f109a206ccc5fdd869de833a97e0d1b9a09a2 (diff)
parent8ea2abcb0ff0f2e23391dbde621d62c0980138e7 (diff)
Merge "Don't panic in ModuleForTests and friends" into main am: 4a80748e09 am: 8ea2abcb0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3490133 Change-Id: If401bc7e4ed94f982391e49aa059015cbaecca5f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'java/testing.go')
-rw-r--r--java/testing.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/testing.go b/java/testing.go
index 0a032526c..b3071d7c6 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -604,7 +604,7 @@ func gatherRequiredDepsForTest() string {
func getModuleDependencies(t *testing.T, ctx *android.TestContext, name, variant string) []string {
t.Helper()
- module := ctx.ModuleForTests(name, variant).Module()
+ module := ctx.ModuleForTests(t, name, variant).Module()
deps := []string{}
ctx.VisitDirectDeps(module, func(m blueprint.Module) {
deps = append(deps, m.Name())
@@ -635,7 +635,7 @@ func CheckModuleHasDependency(t *testing.T, ctx *android.TestContext, name, vari
// CheckModuleHasDependency returns true if the module depends on the expected dependency.
func CheckModuleHasDependencyWithTag(t *testing.T, ctx *android.TestContext, name, variant string, desiredTag blueprint.DependencyTag, expected string) bool {
- module := ctx.ModuleForTests(name, variant).Module()
+ module := ctx.ModuleForTests(t, name, variant).Module()
found := false
ctx.VisitDirectDepsWithTags(module, func(m blueprint.Module, tag blueprint.DependencyTag) {
if tag == desiredTag && m.Name() == expected {
@@ -671,7 +671,7 @@ func CheckClasspathFragmentProtoContentInfoProvider(t *testing.T, result *androi
// name of the apex, or platform is it is not part of an apex and <module> is the module name.
func CheckPlatformBootclasspathDependencies(t *testing.T, ctx *android.TestContext, name, variant string, expected []string) {
t.Helper()
- platformBootclasspath := ctx.ModuleForTests(name, variant).Module().(*platformBootclasspathModule)
+ platformBootclasspath := ctx.ModuleForTests(t, name, variant).Module().(*platformBootclasspathModule)
modules := []android.Module{}
ctx.VisitDirectDeps(platformBootclasspath, func(m blueprint.Module) {
modules = append(modules, m.(android.Module))
@@ -746,7 +746,7 @@ func CheckHiddenAPIRuleInputs(t *testing.T, message string, expected string, hid
// Check that the merged file create by platform_compat_config_singleton has the correct inputs.
func CheckMergedCompatConfigInputs(t *testing.T, result *android.TestResult, message string, expectedPaths ...string) {
- sourceGlobalCompatConfig := result.SingletonForTests("platform_compat_config_singleton")
+ sourceGlobalCompatConfig := result.SingletonForTests(t, "platform_compat_config_singleton")
allOutputs := sourceGlobalCompatConfig.AllOutputs()
android.AssertIntEquals(t, message+": output len", 1, len(allOutputs))
output := sourceGlobalCompatConfig.Output(allOutputs[0])