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/mutator.go b/android/mutator.go
index e20bc2c..04407eb 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -78,11 +78,13 @@
RegisterDefaultsPreArchMutators,
}
+func registerArchMutator(ctx RegisterMutatorsContext) {
+ ctx.BottomUp("arch", archMutator).Parallel()
+ ctx.TopDown("arch_hooks", archHookMutator).Parallel()
+}
+
var preDeps = []RegisterMutatorFunc{
- func(ctx RegisterMutatorsContext) {
- ctx.BottomUp("arch", archMutator).Parallel()
- ctx.TopDown("arch_hooks", archHookMutator).Parallel()
- },
+ registerArchMutator,
}
var postDeps = []RegisterMutatorFunc{