summaryrefslogtreecommitdiff
path: root/java/testing.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/testing.go
parentc0a00df42e8f63caa3070c80a1e40db22bc574cc (diff)
parent90607e9056f6ff4cec2447fdd7a8b252d67ffde7 (diff)
Merge "Don't panic in ModuleForTests and friends" into main
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 b3e552658..35319ae58 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -605,7 +605,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())
@@ -636,7 +636,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 {
@@ -672,7 +672,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))
@@ -747,7 +747,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])