summaryrefslogtreecommitdiff
path: root/java/testing.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-09-06 18:51:55 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-09-06 18:51:55 +0000
commit720d25a1e21cc47a914224ac3fbc9ae87ee79574 (patch)
tree3eb2af7cd296c8d59238958efd6cc326dd9af876 /java/testing.go
parent63abf09fd92ab7c12e08bbef5aef3e464207f9f8 (diff)
parentace2d9884a9957b3e538f171786a7a5d7392fb82 (diff)
Merge "Make the java static_libs property configurable" into main am: 219009f606 am: ace2d9884a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3254302 Change-Id: I9e691f10c574e768392532e22f55ccafbcc3cd34 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.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/testing.go b/java/testing.go
index 98e2aeb77..6ed605475 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -634,6 +634,18 @@ func CheckModuleHasDependency(t *testing.T, ctx *android.TestContext, name, vari
return false
}
+// 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()
+ found := false
+ ctx.VisitDirectDepsWithTags(module, func(m blueprint.Module, tag blueprint.DependencyTag) {
+ if tag == desiredTag && m.Name() == expected {
+ found = true
+ }
+ })
+ return found
+}
+
// CheckPlatformBootclasspathModules returns the apex:module pair for the modules depended upon by
// the platform-bootclasspath module.
func CheckPlatformBootclasspathModules(t *testing.T, result *android.TestResult, name string, expected []string) {