summaryrefslogtreecommitdiff
path: root/java/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/testing.go')
-rw-r--r--java/testing.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/java/testing.go b/java/testing.go
index 03dcee667..0c79e9f7e 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -581,6 +581,7 @@ func gatherRequiredDepsForTest() string {
name: "%[1]s-lib",
sdk_version: "none",
system_modules: "none",
+ srcs: ["a.java"],
}
`, extra)
}
@@ -632,6 +633,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) {
@@ -780,3 +793,5 @@ func FixtureSetBootImageInstallDirOnDevice(name string, installDir string) andro
config.installDir = installDir
})
}
+
+var PrepareForTestWithTransitiveClasspathEnabled = android.PrepareForTestWithBuildFlag("RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH", "true")