summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2024-10-01 14:02:12 -0700
committer Colin Cross <ccross@android.com> 2024-10-02 11:48:44 -0700
commitf22fe41cdcb9097e898892806f8aee1cc2df3e59 (patch)
treef0be57868ce64aa9f60963f942c282239478f61b /android/testing.go
parentcceefc885db4bf7c6e03950abc2c947d195fcd68 (diff)
Add PostApex mutator stage
The sabi mutator needs to run after the apex mutator because it accesses the apex providers. Right now it ensures it runs later by running in the FinalDeps stage, but that prevents it from being converted to a TransitionMutator. Add a PostApex mutator stage that runs after PostDeps but before FinalDeps. Test: all soong tests pass Bug: 367784740 Flag: EXEMPT refactor Change-Id: I539f38ab6faa49972ec908cd54e5c80a8185ec6c
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/android/testing.go b/android/testing.go
index 196b22e3e..7440869f3 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -197,8 +197,8 @@ func NewTestArchContext(config Config) *TestContext {
type TestContext struct {
*Context
- preArch, preDeps, postDeps, finalDeps []RegisterMutatorFunc
- NameResolver *NameResolver
+ preArch, preDeps, postDeps, postApex, finalDeps []RegisterMutatorFunc
+ NameResolver *NameResolver
// The list of singletons registered for the test.
singletons sortableComponents
@@ -229,6 +229,10 @@ func (ctx *TestContext) PostDepsMutators(f RegisterMutatorFunc) {
ctx.postDeps = append(ctx.postDeps, f)
}
+func (ctx *TestContext) PostApexMutators(f RegisterMutatorFunc) {
+ ctx.postApex = append(ctx.postApex, f)
+}
+
func (ctx *TestContext) FinalDepsMutators(f RegisterMutatorFunc) {
ctx.finalDeps = append(ctx.finalDeps, f)
}
@@ -449,7 +453,7 @@ func globallyRegisteredComponentsOrder() *registrationSorter {
func (ctx *TestContext) Register() {
globalOrder := globallyRegisteredComponentsOrder()
- mutators := collateRegisteredMutators(ctx.preArch, ctx.preDeps, ctx.postDeps, ctx.finalDeps)
+ mutators := collateRegisteredMutators(ctx.preArch, ctx.preDeps, ctx.postDeps, ctx.postApex, ctx.finalDeps)
// Ensure that the mutators used in the test are in the same order as they are used at runtime.
globalOrder.mutatorOrder.enforceOrdering(mutators)
mutators.registerAll(ctx.Context)