summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/android/testing.go b/android/testing.go
index fa4dffd9b..39a268b23 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -203,7 +203,17 @@ func (ctx *TestContext) HardCodedPreArchMutators(f RegisterMutatorFunc) {
ctx.PreArchMutators(f)
}
-func (ctx *TestContext) ModuleProvider(m blueprint.Module, p blueprint.ProviderKey) interface{} {
+func (ctx *TestContext) ModuleProvider(m blueprint.Module, p blueprint.AnyProviderKey) any {
+ value, _ := ctx.Context.ModuleProvider(m, p)
+ return value
+}
+
+func (ctx *TestContext) ModuleHasProvider(m blueprint.Module, p blueprint.AnyProviderKey) bool {
+ _, ok := ctx.Context.ModuleProvider(m, p)
+ return ok
+}
+
+func (ctx *TestContext) moduleProvider(m blueprint.Module, p blueprint.AnyProviderKey) (any, bool) {
return ctx.Context.ModuleProvider(m, p)
}
@@ -225,6 +235,12 @@ func (ctx *TestContext) PreArchBp2BuildMutators(f RegisterMutatorFunc) {
ctx.bp2buildPreArch = append(ctx.bp2buildPreArch, f)
}
+func (ctx *TestContext) OtherModuleProviderAdaptor() OtherModuleProviderContext {
+ return NewOtherModuleProviderAdaptor(func(module blueprint.Module, provider blueprint.AnyProviderKey) (any, bool) {
+ return ctx.moduleProvider(module, provider)
+ })
+}
+
// registeredComponentOrder defines the order in which a sortableComponent type is registered at
// runtime and provides support for reordering the components registered for a test in the same
// way.