Add test infrastructure for running the arch mutator
Add TestArchConfig and NewTestArchContext to create a test context
that will run the arch mutator, which is necessary to test any code
that is inside a ctx.Device() block or similar.
Test: next patch
Change-Id: Ieb1a0326bc27fc18ba88b8d37655a7e0c6870d6c
diff --git a/android/testing.go b/android/testing.go
index 4144775..519e279 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -27,6 +27,12 @@
}
}
+func NewTestArchContext() *TestContext {
+ ctx := NewTestContext()
+ ctx.preDeps = append(ctx.preDeps, registerArchMutator)
+ return ctx
+}
+
type TestContext struct {
*blueprint.Context
preArch, preDeps, postDeps []RegisterMutatorFunc